for (keys %total) { push @matches, $_ if $_ eq "$item"; } #### push @matches, $item if exists $total{$item};