# Inside the Garage class, which will contain a list of Nash Ramblers... # Get info on some of them that the garage cares about. my $query = 'select owner, mileage, color, ... from nash_ramblers ...'; my $result_ref = $dbh->selectall_arrayref( ... ); $self->{nash_ramblers} = []; # Store the list in this instance attribute. for ( @{$result_ref} ) { my $a_ref = $_; my $car_ref = NashRambler->new(); $car_ref->set_owner( $a_ref->[0] ); $car_ref->set_mileage( $a_ref->[1] ); $car_ref->set_color( $a_ref->[2] ); # ... snip a bunch of similar setter calls ... push @{ $self->{nash_ramblers} }, $car_ref; } # Ok, now for the Cadillacs...