Skip Menu |

This queue is for tickets about the Devel-Caller CPAN distribution.

Report information
The Basics
Id: 2878
Status: resolved
Priority: 0/
Queue: Devel-Caller

People
Owner: RCLAMP [...] cpan.org
Requestors:
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.08
Fixed in: (no value)



Subject: called_with(0,1) misbehaving
This is with PadWalker-0.09, Devel-Caller-0.08, on the same perl as reported at http://www.xray.mpe.mpg.de/mailing-lists/cpan-testers/2003-07/msg00056.html #!/usr/bin/perl use strict; use warnings; use Devel::Caller qw( called_with caller_vars ); use Data::Dumper; my $coy = rand 6; warn "huh?\n", real( $coy, $coy ); warn "----"; warn "confusing\n", print $/, real( $coy, $coy ); print "$/ even more confusing $/", real( $coy, $coy ); sub real { my @called = called_with(0,1); return Dumper( \@called ); } __END__ huh? $VAR1 = [ undef ]; ---- at test.pl line 10. $VAR1 = [ undef, '$coy', '$coy' ]; confusing 1 at test.pl line 11. even more confusing $VAR1 = [ '$main::/', undef, '$main::/' ];
[PODMASTER - Tue Jul 1 21:57:03 2003]: Show quoted text
> This is with PadWalker-0.09, Devel-Caller-0.08, on > the same perl as reported at >
http://www.xray.mpe.mpg.de/mailing-lists/cpan-testers/2003-07/msg00056.html Show quoted text
> > #!/usr/bin/perl > use strict; > use warnings; > use Devel::Caller qw( called_with caller_vars ); > use Data::Dumper; > > my $coy = rand 6; > > warn "huh?\n", real( $coy, $coy ); > warn "----"; > warn "confusing\n", print $/, real( $coy, $coy ); > > print "$/ even more confusing $/", real( $coy, $coy ); > > sub real { > my @called = called_with(0,1); > return Dumper( \@called ); > } > __END__ > huh? > $VAR1 = [ > undef > ]; > ---- at test.pl line 10. > > $VAR1 = [ > undef, > '$coy', > '$coy' > ]; > confusing > 1 at test.pl line 11. > > even more confusing > $VAR1 = [ > '$main::/', > undef, > '$main::/' > ];
Thanks for the catch. It seems to be a bug in the way that I walk the optree back to the start of the parameter list, such that given C<"".real( $coy, $coy );> it starts at the string constant rather than the first $coy. I've added a modified version of your code to my testsuite, and hope to have have a better idea of when I'll have a fix later. -- Richard Clamp <richardc@unixbeard.net>
[RCLAMP - Mon Jul 7 12:59:00 2003]: Show quoted text
> Thanks for the catch. It seems to be a bug in the way that I walk the > optree back to the start of the parameter list, such that given > C<"".real( $coy, $coy );> it starts at the string constant rather than > the first $coy. > > I've added a modified version of your code to my testsuite, and hope to > have have a better idea of when I'll have a fix later.
I now have a fix for one variant of this. I can now properly handle "".real( $coy, $coy ); but still fail to properly navigate "".real( $coy ).real( $haddock ); - the second call finds its way to the parameter list for the first invocation and so returns '$coy' rather than '$haddock' Sorry for the extended pause in an update - I'll put out an interim release some time today of the current state. -- Richard Clamp <richardc@unixbeard.net>