Don't ask to ask, just ask | |
PerlMonks |
Re^2: Hmmm: while(), file handle and $_ gotchaby roboticus (Chancellor) |
on Mar 06, 2009 at 12:59 UTC ( [id://748843]=note: print w/replies, xml ) | Need Help?? |
moritz:
OK, that explains it. (I had an incorrect mental model: I was thinking that <FH> always put the data somewhere, using $_ unless otherwise specified. I don't know how I came to think that, as in hindsight that would be clearly stupid. Oh, well--live and learn!) So the correct fix to my program would is to change the inner loop from:
to
so I can avoid unnecessary variables and clutter. Thank you! ...roboticus
In Section
Seekers of Perl Wisdom
|
|