in reply to Re: I need a simple explantion of the difference between my() and local()
in thread I need a simple explantion of the difference between my() and local()
Given Ovid's recent diatribe on questioning authority, I am going to call you on this one. I understand your wanting to make a simple answer here, but there is a slightly less simple but infinitely more valuable way to put this. "Always use my unless you are localizing a perl internal variable, such as one from perldoc perlvar." I think newbies will understand that they are not localizing a perl variable, and probably will glaze over it if it isnt applicable. To those whom it is applicable, they will understand right away that at the least they need to do something different, and hopefully ask a question.
For further clarity, I'd like to point out merlyn's excellent catch here, Re: Re: Re: Optimization for readability and speed (discussion), wherein he caught me messing about with $" when I should have been using local but wasnt. The node is in a simple context that I think most perl hackers can understand, even something-above-brand-new-newbies-to-perl'ers.
yours in perl
brother dep.
--
Laziness, Impatience, Hubris, and Generosity.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 3: I need a simple explantion of the difference between my() and local() (discussion)
by tilly (Archbishop) on May 04, 2001 at 00:42 UTC | |
by buckaduck (Chaplain) on May 04, 2001 at 01:32 UTC | |
by tilly (Archbishop) on May 04, 2001 at 01:44 UTC | |
by buckaduck (Chaplain) on May 04, 2001 at 02:03 UTC | |
by tilly (Archbishop) on May 04, 2001 at 21:27 UTC |