On Thu, Dec 02, 2004 at 06:04:11PM -0800, Brian Ingerson wrote: > Hi All, > > Here's a script that shows a definite change between 5.8.5 and 5.8.6. It > causes Spiffy::super() to not work, which is an integral part of the > Kwiki framework. I've whittled it down to this so far: > > #!/usr/lang/perl/5.8.6/bin/perl > use Data::Dumper; > > foo(1..3); > > sub foo { > @_ = (4..6); > goto &bar; > } > > sub bar { > shift; > print Data::Dumper::Dumper(DB::get_args(1)); > } > > package DB; > sub get_args { > my @dummy = caller(shift); > @DB::args; > } > > Prior to 5.8.6 we get: > > $VAR1 = 4; > $VAR2 = 5; > $VAR3 = 6; > > With 5.8.6 we get: > > $VAR1 = undef; > $VAR2 = 5; > $VAR3 = 6; > > Is there a fast fix to this, or should I start looking for a workaround? > > Cheers, Brian
OK, I added a few print statements to clear thing up for me somewhat. The code still is a bit mirky to me, since I honestly have no clue how DB::args is getting populated (someone please explain, if you can). Anyways, foo() seems to be the sticking point. Changing @_ to @foo and passing it to bar rather than doing a goto seems to work. I've tried on 5.8.0, 5.8.5, and 5.8.6 with identical results. As for the actual cause, it is likely related to how @DB::args is getting populated, but since I don't know how that is happening, I can't be much more help for you. Steve Peters [EMAIL PROTECTED] use Data::Dumper; foo(1..3); sub foo { @foo = (4..6); bar(@foo); } sub bar { print join qw/ : /, @_; print "\n"; shift; print join qw/ : /, @_; print "\n"; print Data::Dumper::Dumper(DB::get_args(1)); } package DB; print @args; sub get_args { print join qw/ : /, @_; print "\n"; my @dummy = caller(shift); print join qw/ : /, @dummy; print "\n"; @DB::args; print join qw/ : /, @DB::args; print "\n"; return @DB::args; }
