sub new { my $proto = shift(@_); my $class = ref($proto) || $proto; my @results; for my $userId (@_) { my $self = { "user_id"=> undef, "user_name" => undef }; bless ($self, $class); my $href = GETSQL("SELECT user_name FROM users WHERE user_id = $userId"); @{$self}{keys %{$href}} = values %{$href}; push @results, $self; } return @results; }