Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: dbh->disconnect or leave to scope

by nikosv (Chaplain)
on Jan 18, 2011 at 10:18 UTC ( #882839=note: print w/ replies, xml ) Need Help??

in reply to dbh->disconnect or leave to scope

Perl uses reference counting so when your object goes out of scope or the references are explicitly undefed then it calls the object's destructor.

Of course when the resource is reclaimed is variable. But for the object to be destructed reference counting must reach 0.

Bottom line is, when you use a Perl module, destrcution is handled by Perl automatically.The problem is when you call 'unmanaged' resources, for example calling a C++ dll.

There you have to follow the API's documentation on how to release the resourcse,explictly

Comment on Re: dbh->disconnect or leave to scope

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://882839]
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: (9)
As of 2016-05-26 19:40 GMT
Find Nodes?
    Voting Booth?