This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make __DATA__ use the right pkg
__DATA__ is supposed to stuff the rest of the file into the DATA han-
dle belonging to the package in scope where __DATA__ is encountered.
That means this should always print 123:
print <DATA>;
__DATA__
123
But it fails if the package has been renamed through glob assignment:
package foo;
BEGIN{*foo::=*bar::}
print <DATA>;
__DATA__
123
(Prints nothing.)
The code for stuffing DATA was stringifying the package and then look-
ing it up again. Not only is it more correct to avoid the stringifi-
cation, but faster, too.