once the namespace has gone out of scope, the variables are all cleared. if you're talking about CGI scripts, Perl's internal garbage collection cleans out the namespace when the script exits ( since all variables have gone out of scope, i.e. no references to them.)
i've always just used undef $foo when i've needed to explicitly blow away an instance of a variable.
you can always just re-assign values. coding $foo = 'blalal'; after $foo gets a value is appropriate.
if you need to blow away a namespace in the middle of a script i suspect there's something lacking in the design ( esp. if variable re-assignment doesn't fit the task).
UPDATE: merlyn has corrected me on terminology. namespaces don't go out of scope. variables in a namespace go out of scope.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.