Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Don't get too cute about modifying and using @_ in the same line of code

by GlitchMr (Sexton)
on Aug 23, 2012 at 08:53 UTC ( #989244=note: print w/replies, xml ) Need Help??

in reply to Don't get too cute about modifying and using @_ in the same line of code

Doesn't happen for me with following code.

use strict; use warnings; package Package1; use Data::Dumper; sub some_other_method { print Dumper @_; } package Package2; our @ISA = 'Package1'; sub some_other_method { die "Shouldn't be called!"; } sub quick_method { return shift->SUPER::some_other_method(@_); } sub new { bless {}, shift; } Package2->new->quick_method( 1, 2, 3 );

It returns (correctly) following result (I've checked it in Perl v5.8.8, v5.10.1, v5.14.2, v5.16.1 and blead).

$VAR1 = bless( {}, 'Package2' ); $VAR2 = 1; $VAR3 = 2; $VAR4 = 3;

But, I think that so simple code won't show the bug - it happens in more complex cases (the warning you have got is internal Perl warning you should never see, but you saw according to perldiag - this is possibly a Perl bug). If you can, try to make testcase which shows the bug happening (by shortening the program to only have what you need to show bug). Also, there is chance that some XS module breaks something.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://989244]
[Discipulus]: choroba i made you Bishop !!
[choroba]: 9999 points until level 23 - Archbishop.
[LanX]: darn trying to downvote him again fails ... ;-P
[Discipulus]: congrats!
[LanX]: His Excelleny Choroba will now nbe clothed in his new robe ...
[Discipulus]: bishop ship sheeps in the shop..
[1nickt]: Discipulus too easy!
[1nickt]: "The sixth sheik's sixth sheep's sick" (if you are after 'sh' tongue twisters)
[Discipulus]: ok try it in Eatalian ;=)
[Eily]: Discipulus I don't suppose you can do the same for me can you ? :P

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (11)
As of 2017-09-26 12:00 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (294 votes). Check out past polls.