http://qs321.pair.com?node_id=192632


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; }

-rattus
__________
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)