Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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

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


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 07: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
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2025-06-22 18:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.