in reply to my and local??
Read merlyn's and jlistf's posts above. The only thing I wanted to add was to make it clear that local restores the old value after the localized variable goes out of scope. This has both good and bad repercutions. Good in that it allows for things like a recursive function that uses a global variable, bad in that the variable could be created inside a block, and when the block goes out of scope you are holding undef.
Also, the best text explanation I've seen on all this is Sriam Srinivasan's "Advanced Perl Programming" available from O'Reilly. I think that's a black panther on the cover. (My HS mascot)
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: RE: my and local??
by KM (Priest) on Jul 28, 2000 at 22:16 UTC | |
by Adam (Vicar) on Jul 28, 2000 at 22:24 UTC |
In Section
Seekers of Perl Wisdom