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?
Back to
Seekers of Perl Wisdom