my $object = Itiv::Hw->new(); my ($cols, $hw) = $object->all_hw($dbh, $filter); # and then... foreach (@$cols) { .... }