Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re^3: Build a list of defined var's

by merlyn (Sage)
on Oct 20, 2009 at 21:40 UTC ( #802328=note: print w/ replies, xml ) Need Help??

in reply to Re^2: Build a list of defined var's
in thread Build a list of defined var's

Surely you don't want to reset everything, as that would also reset things like @INC, making your program a little brain-dead. I mean, that's one of the reasons that perldoc -f reset includes the paragraph:

Resetting "A-Z" is not recommended because you'll wipe out + your @ARGV and @INC arrays and your %ENV hash. Resets only pack +age variables--lexical variables are unaffected, but they clea +n themselves up on scope exit anyway, so you'll probably wan +t to use them instead. See "my".

The proper way to go about this is to use proper objects in your program, so that you can have a top level object that is associated with a particular session, and everything else hangs off of that. Then, to reset the session, just generate a new session object.

-- Randal L. Schwartz, Perl hacker

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Comment on Re^3: Build a list of defined var's
Select or Download Code
Re^4: Build a list of defined var's
by ikegami (Pope) on Oct 20, 2009 at 21:50 UTC

    So just reload the modules.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://802328]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2014-08-01 23:52 GMT
Find Nodes?
    Voting Booth?

    Who would be the most fun to work for?

    Results (53 votes), past polls