my $recs = $dbh->selectall_arrayref( $sql ); my @people; foreach my $rec ( @$recs ) { my $i = 0; my $person = Person->new(); foreach my $meth ( map { $person->can($meth) } qw( name hight weig +ht age gender dob ) ) { $person->$meth( $rec->[$i++] ) if $meth; } push @people, $person; }
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
In reply to Re: YAOOM
by dragonchild
in thread YAOOM
by mortis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |