my @objects; while ( @info = $sth->fetchrow_array ) { my $object = Object->new(); $object->set_fname( $info[0] ); $object->set_lname( $info[1] ); ... # or my $object = Object->new( @info ); # or my $object = Object->new( fname => $info[0], lname => $info[1], ... ); push @objects, $object } for ( @objects ) { # do something with the object }