sub _fill_lists { my ($thing, $thing_ref) = @_; my $class = "My::Class::$thing"; # <== if (ref $giant_hash{$thing} eq 'ARRAY') { for (@{ $giant_hash{$thing} }) { push @{ $thing_ref }, $class->new( $_ ); # <== } } else { push @{ $thing_ref }, $class->new( $giant_hash{$thing} ); # <== } }