in reply to DBI::mySQL - philosophical question?

You could
  1. pass the $dbh into the functions as a parameter.
  2. Declare my $dbh at the beginning of the script if you don't need to share it with other packages/files
  3. Make it a package var. There is nothing wrong with this when it makes sense.
Connections are slow, it would be ridiculous to keep establishing db connections for the sake of dogma.


-Lee

"To be civilized is to deny one's nature."
  • Comment on Re: DBI::mySQL - philosophical question?