shmem has asked for the wisdom of the Perl Monks concerning the following question:
Update: Scratch that, reap the post, call me a fool. I should have invoked perl with the -l switch. The behavior is consistent. I dinn' catch the string "bug!" just in front of the shell prompt.
Update: changed title
Dear fellow monks,
playing with prototypes for a future perl talk at $work, I stumbled over the following (perl v5.14.3):
# file proto.pl sub fn($); fn("no bug."); sub fn (\@) { print while $_ = shift; } __END__ Prototype mismatch: sub main::fn ($) vs (\@) at proto.pl line 6.
That's fine and expected.
However, if the parameter list @_ isn't altered via shift, the fatal error is turned into a warning:
# file proto.pl sub fn($); fn("bug!"); sub fn (\@) { print $_,$/ for @_; } __END__ Prototype mismatch: sub main::fn ($) vs (\@) at proto.pl line 6. bug!
Would you consider that a bug, and if so, is it worth reporting?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: yet another prototype bug?
by LanX (Saint) on May 31, 2013 at 10:21 UTC | |
Re: yet another prototype bug?
by choroba (Cardinal) on May 31, 2013 at 10:35 UTC | |
Re: yet another prototype bug?
by Anonymous Monk on May 31, 2013 at 10:35 UTC | |
Re: yet another prototype bug?
by BrowserUk (Patriarch) on May 31, 2013 at 10:23 UTC | |
by shmem (Chancellor) on May 31, 2013 at 10:28 UTC | |
by BrowserUk (Patriarch) on May 31, 2013 at 10:34 UTC | |
Re: yet another prototype bug?
by Anonymous Monk on May 31, 2013 at 10:26 UTC |
Back to
Seekers of Perl Wisdom