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)