This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Stop ck_rvconst from treating GV constants as strings
sub foo { 42 }
use constant bar => *foo;
BEGIN { undef *foo }
warn &{+bar};
warn bar->();
Obviously the last two lines should print the same thing, because they
both call the value of the ‘bar’ constant as a suroutine.
But op.c:ck_rvconst messes up the ‘bar->()’ at compile time, treating
the bar glob (a copy of the original *foo glob, and not the *foo glob
itself, which has since been undefined) as a string and using it to
look up a glob.
ck_rvconst should not do anything if the constant’s value is a glob.