http://www.perlmonks.org?node_id=510913
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(Main.pm), 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,
Main::new($dbh);

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