my (@friends, @results); for (@raw_list) { my %who; @who{qw( FIRSTNAME LASTNAME HAIRCOLOR )} = split /,/; push @friends, \%who; } @results = grep { lc($_->{HAIRCOLOR}) eq 'brown' and lc(substr($_->{FIRSTNAME})) eq 'j' } @friends;