#320 AutoLoader leaks $_ into local context

closed-fixed
nobody
core (120)
7
2013-02-04
2013-02-04
No

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>

Discussion

  • Craig DeForest

    Craig DeForest - 2013-02-04
    • status: open --> closed-fixed
     
  • Craig DeForest

    Craig DeForest - 2013-02-04

    Problem was that PDL::NiceSlice::perldlpp was not localizing $_. Now it does.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks