http://qs1969.pair.com?node_id=726732


in reply to Re^2: variable mystery
in thread variable mystery

C:\>perl -v This is perl, v5.8.7 built for MSWin32-x86-multi-thread ... C:\>perl -MO=Deparse -le"for my $_ (1..2) { print } Can't use global $_ in "my" at -e line 1, near "my $_ " -e had compilation errors. BEGIN { $/ = "\n"; $\ = "\n"; } foreach $_ (1 .. 2) { print $main::_; } C:\strawberry\perl\bin>perl -MO=Deparse -le"for my $_ (1..2) { print } BEGIN { $/ = "\n"; $\ = "\n"; } foreach my $_ (1 .. 2) { print $_; } -e syntax OK C:\strawberry\perl\bin>perl -v This is perl, v5.10.0 built for MSWin32-x86-multi-thread ...