This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Allow the \$ proto to accept any scalar lvalue [perl #91846]
This makes the \$ prototype’s parsing the same as the second argument
to read(), making it possible to create a custom myread() function
that has the same syntax.
This is handled in two places in the prototype-parsing code, to avoid
calling scalar() on the op if another character in \[...] will accept
it. I don’t know what the consequences of that would be. So it calls
Perl_op_lvalue_flags in the $ case only if it is not inside brackets.
Then in the ] case it checks to see whether there was a $.
OP_READ, not OP_ENTERSUB, is passed as the type to
Perl_op_lvalue_flags, since OP_ENTERSUB would allow sub foo(\$) to
accept an array as an argument. OP_RECV and OP_SYSREAD would have
worked, too.