in reply to Passing a database connection
Hey!
Shouldn't my $dbh; sub new { $dbh = @_; } actually be my $dbh; sub new { $dbh = @_[0]; } ? Try it! It might work! This is because when passing arguments, the @_ has to have an index, starting at 0. If you would have two arguments, one would be @_[0](this is equal to your first argument) and another would be @_1(this is equal to your second, which you luckily don't have).
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Passing a database connection
by ikegami (Patriarch) on Nov 22, 2005 at 21:37 UTC | |
Re^2: Passing a database connection
by dragonchild (Archbishop) on Nov 23, 2005 at 02:23 UTC | |
by doob (Pilgrim) on Nov 23, 2005 at 19:24 UTC |
In Section
Seekers of Perl Wisdom