|
|
|
good chemistry is complicated, and a little bit messy -LW |
|
| PerlMonks |
Re: Examples fo Where "our" is really neededby rg0now (Chaplain) |
| on May 05, 2005 at 18:02 UTC ( #454452=note: print w/ replies, xml ) | Need Help?? |
|
Please, ignore this node, I wrote it before actually thinking. I am stupid...
I think a pretty nice use of our is to localize $_. So, for example, with List::MoreUtil you can write code like this:
and here is the code that does the magic: Notice, how you localize the elements of the array one by one, so that you can refer to them as $_ in your code. I do not really know, how could you achieve similar effects without using our, if you can at all, but I am not entirely sure...
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||