Pass it as an argument to the function.
print "info: " , getdb( $dbh ) , "\n"; sub getdb { my $dbh = shift; my $query = $dbh->selectrow_hashref("SELECT something FROM a_table +"); return $query->{'explanation'}; }
In reply to Re: Using objects in exported functions
by chromatic
in thread Using objects in exported functions
by discore
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |