http://www.perlmonks.org?node_id=759661


in reply to Re^2: my $1
in thread my $1

Baah, this gives me creeps.
perl -e '@foo = map {$_=2; foo()} 1..10; sub foo{print}' 2222222222 $ perl -e '@foo = map {my $_=2; foo()} 1..10; sub foo{print}' 12345678910

print "just another perl5.8 hacker"

Replies are listed 'Best First'.
Re^4: my $1
by JavaFan (Canon) on Apr 23, 2009 at 22:08 UTC
    Baah, this gives me creeps.
    Does this give you also the creeps?
    $ perl -e 'for $x (1 .. 9) {$x = 2; foo ()} sub foo {print $x}' 222222222 $ perl -e 'for $x (1 .. 9) {my $x = 2; foo ()} sub foo {print $x}' 123456789
    Or is it the fact that Perl just got a little bit more regular that creeps you out?