in reply to Re^2: Arrays and Handles Problem
in thread Arrays and Handles Problem
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
|
|---|