in reply to Re^5: (in cleanup) Can't call method "close" on an undefined value at somePerlModule.pm line number.
in thread (in cleanup) Can't call method "close" on an undefined value at somePerlModule.pm line number.
If for example, your class uses a database, the destructor would be a good place to close the connection.
Yup, but DBI connections already come with a destructor that closes the connection, so :)
Another use scenario is to break circular references, but those are easily avoided with https://metacpan.org/pod/Scalar::Util#weaken
Yup, in perl, I've rarely written a destructor
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: (in cleanup) Can't call method "close" on an undefined value at somePerlModule.pm line number.
by BrowserUk (Patriarch) on Feb 01, 2015 at 21:36 UTC |