in reply to Re^4: $dbh could not be passed to function unless another variable is also passed
in thread $dbh could not be passed to function unless another variable is also passed
my $dbh = "$_[0]";
What is in $dbh and why do you force it to a string?
Also, what is the error message? It is most likely something like Can't call method prepare on DBD::foo::dbh, but telling us the exact error message helps us much better diagnose your situation.
The solution is to not quote variables when you don't need it. Remove the double quotes:
my $dbh = $_[0];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: $dbh could not be passed to function unless another variable is also passed
by tukusejssirs (Beadle) on Aug 08, 2019 at 14:53 UTC | |
by hippo (Archbishop) on Aug 08, 2019 at 14:58 UTC | |
by dsheroh (Monsignor) on Aug 09, 2019 at 07:24 UTC |