Spidy has asked for the wisdom of the Perl Monks concerning the following question:

I'm writing some database code that involves modules, but I'm having a strange issue.

Inside my module(, I have this piece of code:
my $dbh; sub new { $dbh = @_; }

Which is ideally supposed to take the database connection passed to it, so that the module can use it. However, I'm having some issues. Inside my main script, I do this:
# $dbname, $uname, $pword have already been filled in. my $dbh = DBI->connect("DBI:mysql:$dbname:localhost","$uname","$pword" +);

and then later on,

However, I'm getting an error for, which is
Can't locate object method "selectrow_array" via package "Main" at Mai line ***.
Anyone have any ideas?