Fix readline overriden with a constant
<> doesn’t take into account that some subs are stored in a more
lightweight form than usual. These two programs should behave the
same way, but, as you can see below the __END__ markers, the output is
different:
use constant foo=>1;
BEGIN { *{"CORE::GLOBAL::readline"} = \&{"foo"}; 1}
warn <a>
__END__
Warning: something's wrong at - line 3.
use constant foo=>1;
BEGIN { *{"CORE::GLOBAL::readline"} = \&foo; 1}
warn <a>
__END__
Too many arguments for main::foo at - line 3, at end of line
Execution of -e aborted due to compilation errors.
The latter is the correct behaviour. The only different is \&{"foo"}
vs \&foo, the first of which triggers an optimisation.
S_scan_inputsymbol in toke.c needs to take the optimisation into
account (that stash entries are not necessarily globs but can be
upgraded to such).