readline argument list is messed up #15706
Created by @mauke
$ perl -wE 'say prototype "CORE::readline"'
readline claims to take a single (optional) scalar argument.
$ perl -wE 'sub foo (;*); foo("a", "b", "c")'
This is what happens when you use the same prototype on a sub.
$ perl -wE 'say readline("a", "b", "c")'
This is what happens when you try it with readline: Only the last argument is
$ perl -wE 'say readline(1 .. 10)'
Despite what the prototype claims, the argument is evaluated in list context.
$ perl -wE 'say "foo", "bar", readline(())'
If you call it with an empty list, it steals arguments from the surrounding
On Sat, 12 Nov 2016 15:13:51 GMT, mauke- wrote:
Is this problem similar to that reported by sprout in https://rt-archive.perl.org/perl5/Ticket/Display.html?id=93992?
James E Keenan via RT <firstname.lastname@example.org> wrote:
No — #93992 is about how Perl should handle subroutine declarations
This ticket relates to the fact that the readline() builtin claims to
FWIW, my recollection is that mauke was working on #130076 at the hackathon.