There's more than one way to do things | |
PerlMonks |
Re^6: $dbh could not be passed to function unless another variable is also passedby tukusejssirs (Beadle) |
on Aug 08, 2019 at 14:53 UTC ( [id://11104183]=note: print w/replies, xml ) | Need Help?? |
Corion: The error was Can't locate object method "prepare" via package "DBI::db=HASH(0x215bc78)" (perhaps you forgot to load "DBI::db=HASH(0x215bc78)"?) You are right. When I removed the quotes (leaving only my $dbh = $_[0];), it works as expected. Anyway, what exactly does ‘The solution is to not quote variables when you don't need it.’ mean? That I should quote only strings? Thank you both!
In Section
Seekers of Perl Wisdom
|
|