![]() |
|
Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Should we Localize $_ ?by Henri Icarus (Beadle) |
on Jun 13, 2001 at 23:38 UTC ( #88180=note: print w/replies, xml ) | Need Help?? |
The The St. Larry Wall Shrine pointed me to Larry's very interesting article Natural Language Principles in Perl which talks about "Local Ambiguity" (search for it). In natural languages you can construct sentences where it's very hard to figure out who the pronouns refer to, and if you (as the listener) get it wrong it may disastrously alter the meaning of the sentence. That's just a side effect have having a powerfull language where it's easy to say things because you can say them economically. Larry said it better:
You learn a natural language once and use it many times. The lesson for a language designer is that a language should be optimized for expressive power rather than for ease of learning. It's easy to learn to drive a golf cart, but it's hard to express yourself in one. Like the previous poster I tend to use an explicit variable for complicated foreach loops because I don't like to use $_ explicitly in function calls or other places far from the source of implicit variable. However, I love it when I can say: instead of not to mention just plain old
-I went outside... and then I came back in!!!!
In Section
Seekers of Perl Wisdom
|
|