in reply to Single row selects with Class::DBI
May I recommend the 'construct' method?
Turn
intosub my_beta_from_alpha { my ($class, %args) = @_; my $sth = $class->sql_by_alpha(@args{qw(bloop glank)}); $sth->execute; my $result = $sth->fetchrow_arrayref; return @$result; }
sub my_beta_from_alpha { my ($class, %args) = @_; my $sth = $class->sql_by_alpha(@args{qw(bloop glank)}); $sth->execute; my $result = $class->construct($sth->fetchrow_hashref); return $result; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Single row selects with Class::DBI
by VSarkiss (Monsignor) on Jan 25, 2005 at 19:09 UTC |