I thought it was okay to use multiple nested instances of $_, and that each was local to its block, but clearly not...
That's true for foreach, but not while (<>):
use warnings; use strict; use Data::Dump; $_ = "foo"; for ("x","y") { dd $_; } dd $_; while (<DATA>) { dd $_; } dd $_; __DATA__ hello
Output:
"x" "y" "foo" "hello\n" undef
In reply to Re^3: Arrays and Handles Problem
by haukex
in thread Arrays and Handles Problem
by Melly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |