Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.

  • $ perl -wle 'package foo; our $_; print map {$_} 1..5'
    Use of uninitialized value in print at -e line 1.
    Use of uninitialized value in print at -e line 1.
    Use of uninitialized value in print at -e line 1.
    Use of uninitialized value in print at -e line 1.
    Use of uninitialized value in print at -e line 1.

    What happened? Well $_ is supposed to be $main::_. But after the our, $_ is now looking at $foo::_ while map still populates $main::_.

    You may find http://www.perlmonks.org/?node_id=48379 [perlmonks.org] to be of interest as well.