Beefy Boxes and Bandwidth Generously Provided by pair Networks Ovid
Just another Perl shrine
 
PerlMonks  

Re: How aggressively does Perl clean up when you exit()?

by grinder (Bishop)
on Nov 14, 2001 at 16:31 UTC ( [id://125373]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to How aggressively does Perl clean up when you exit()?

You can make sure your database handles are closed down correctly by calling the disconnect method in an END block.

END { defined $db and $db->disconnect; }

There is also a module on CPAN yclept1 AtExit that I have never used. For all I know, it predates the appearance of END blocks, but it may be worth a look.

1. Chatterbox silliness. yclept is very olde english, meaning "named".

--
g r i n d e r

Replies are listed 'Best First'.
Re: Re: How aggressively does Perl clean up when you exit()?
by Fletch (Bishop) on Nov 15, 2001 at 02:41 UTC

    END blocks have been around since the dawn of time. They were stolen^Wborrowed from awk.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://125373]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.