On Sat, 12 Nov 2016 15:27:19 GMT, mauke- wrote: > > This is a bug report for perl from l.mai@web.de, > generated with the help of perlbug 1.40 running under perl 5.24.0. > > > ----------------------------------------------------------------- > [Please describe your issue here] > > $ perl -wE 'say prototype "CORE::eof"' > ;* > > eof claims to take a single (optional) scalar argument. > > $ perl -wE 'sub foo (;*); foo("a", "b", "c")' > Too many arguments for main::foo at -e line 1, near ""c") > " > Execution of -e aborted due to compilation errors. > > This is what happens when you use the same prototype on a sub. > > $ perl -wE 'say eof("a", "b", "c")' > Useless use of a constant ("a") in void context at -e line 1. > Useless use of a constant ("b") in void context at -e line 1. > 1 > > This is what happens when you try it with eof: Instead of erroring out > (too > many arguments) it treats it as a scalar comma operator, throwing all > but the > last argument away. > > $ perl -MO=Deparse -e 'eof(())' > eof ARGV; > -e syntax OK > > ... unless the argument is (). Instead of evaluating it in scalar > context (and > getting undef), it silently replaces it by ARGV. > > Is this problem similar to that reported by sprout in https://rt.perl.org/Ticket/Display.html?id=93992? -- James E Keenan (jkeenan@cpan.org) --- via perlbug: queue: perl5 status: new https://rt.perl.org/Ticket/Display.html?id=130077