my %data = ( john => [ ], mike => [ ], harry => [ ] ); foreach my $name(qw/john mike harry/) { push @{ $data{$name} }, any_data_goes_here; }