The text of autoloaded files leaks into $_ on first execution.
# cat > foo.pdl
=head2 foo.pdl - demonstrate POD leakage
=for ref
This pod leaks into local variables.
=cut
sub foo { print "foo: argument is $_[0]\n"; }
^D
#pdl
pdl> eval { @a = (1..5); @b = map { foo($_); } @a; print "\n@a\n"; }
foo: argument is 1
foo: argument is 2
foo: argument is 3
foo: argument is 4
foo: argument is 5
=head2 foo.pdl - demonstrate POD leakage
=for ref
This pod leaks into local variables.
=cut
sub foo { print "foo: argument is $_[0]\n"; }
2 3 4 5
pdl>
Problem was that PDL::NiceSlice::perldlpp was not localizing $_. Now it does.