in reply to Re: Undef doesnt work?This has got me stumped
in thread Undef doesnt work?This has got me stumped

Thanks for the reply. I understand the package variable bit, thanks, but when (or how) does this get destroyed? Does the package reference survive until the script dies?
  • Comment on Re: Re: Undef doesnt work?This has got me stumped

Replies are listed 'Best First'.
Re: Re: Re: Undef doesnt work?This has got me stumped
by broquaint (Abbot) on Feb 09, 2004 at 10:35 UTC
    Correct, package variables live until perl exits, or the variable is explicitly destroyed. If you want shorter lived variables then you'll want to be using lexical variables who's life-span is tied to the length of the surrounding lexical scope (unless they're referenced from a higher scope). For more information on lexical variables see. Lexical scoping like a fox.
    HTH

    _________
    broquaint