The lack of $dbh->disconnect is a potential disaster waiting to happen. Don't know what the SQL server defaults are but by default MySQL will accept 100 connections that will persist for 8 hours. Although it surprised me undefing $dbh (ie when the script finishes) does not cause a DESTROY{ ..disconnect .. ) to be called allowing the connections to persist and accumulate.....until it falls over with a too many connections error. This particular error often goes unnoticed until you get real load on a widget.
One way to code it to make sure this does not happen is
my $sth; my $dbh->connect(...... END{ $sth->finish if $sth; $dbh->disconnect if $dbh } # now do whatever
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
In reply to Re: Search engine code critique
by tachyon
in thread Search engine code critique
by ruhk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |