From as far as I can see, this is expected behaviour - With
CGI::Application, in addition to the
setup method for the establishment of parameters such as database handles, there is also the
teardown method, which is implemented automatically after the application is run and can be used for the clean up of handles and objects that require an explicit closure before script termination.
The error you are experiencing is a result of the DBI handle not being explicitedly disconnected prior to termination of CGI::Application execution - This error is not due to the closure of scope within the setup method. To correct this behaviour, you should make use of the teardown method within your CGI::Application class:
sub teardown {
my $self = shift;
$self->param('mydbh')->disconnect;
}
This should correct your problem. This method and a couple of other 'gotchas' for CGI::Application is described in my review of this module here.
perl -e 's&&rob@cowsnet.com.au&&&split/[@.]/&&s&.com.&_&&&print'
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.