Help for this page
my $query = "SELECT * FROM users WHERE user=?"; my $sth = $dbh->prepare($query); ... my $row = $sth->fetchrow_hashref(); # Then you could call the new method: my $user_info = User->new($row);
package User; ... my($class,$user_info) = @_; return bless $user_info,$class; }