Keep It Simple, Stupid | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Don't be too quick to knock your approach. I find it useful in "real" programs to use a named variable to indicate to my reader (me in most cases :) what I expect that variable to represent. This is especially useful in nested constructs where $_'s semantics change as construct boundaries are crossed.
And if I change a foreach (...) to a while (...), the magic of $_ disappears, and I might introduce bugs similar to gaal's example. Sometimes using explicit variables helps you find logic errors too. -QM In reply to Re^2: Playing with non-localized $_ in nested loops.
by QM
|
|