Think about Loose Coupling | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I think it falls on the programmer's shoulders
to make sure her code does not expect that the
function isn't going to mangle $_. There are just
too many places that $_ could get screwed up.
Besides, I like to explicitly define what the item is that I'm dealing with. I find it much more sane to say, for example: than just implicitly saying Besides, in the latter case, you have to ask yourself a question: "Where is the $_ coming from, and what is it?" It should be every programmer's job to eliminate any such potential questions from the minds of future maintainers, even if it's herself. Can you tell I'm working on my departmental coding standards? :-)
xoxo, %_=split/;/,".;;n;u;e;ot;t;her;c; ". # Andy Lester 'Perl ;@; a;a;j;m;er;y;t;p;n;d;s;o;'. # http://petdance.com "hack";print map delete$_{$_},split//,q< andy@petdance.com > In reply to Re: Should we Localize $_ ?
by petdance
|
|