my $single; sub new { return $single if defined $single; # set up args $self->{dbh} = DBI->connect(@args); $single = bless($self, $class); return $single; } # procedural { my $dbh; sub get_handle { return $dbh if defined $dbh; # handle arguments $dbh = DBI->connect(@args); } }
In reply to Re: checking whether DBI connection made
by chromatic
in thread checking whether DBI connection made
by cLive ;-)
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |