Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Running a sub before a script exits?

by rattusillegitimus (Friar)
on Aug 25, 2002 at 04:13 UTC ( #192632=note: print w/replies, xml ) Need Help??

in reply to Running a sub before a script exits?

Would calling the save_config from a destructor on the object work for you? Something like the following added to package FooBar:

#untested sub DESTROY { my $self = shift; $self->save_config; }

He seemed like such a nice guy to his neighbors / Kept to himself and never bothered them with favors
- Jefferson Airplane, "Assassin"

Replies are listed 'Best First'.
Re: Re: Running a sub before a script exits?
by Anonymous Monk on Aug 25, 2002 at 04:23 UTC
    Thank you SOOOOO much, that works great! I didn't even know about DESTROY :)

      No problem. ;) I highly recommend all the various OO pods as well as theDamian's Object Oriented Perl. (I consulted the latter about DESTROY right before posting)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://192632]
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: (3)
As of 2021-02-28 20:28 GMT
Find Nodes?
    Voting Booth?

    No recent polls found