- or download this
push( @{ $y{ ($a = $_, ( grep {$a=~/$_/} @t )[0] || next)[1] } }, $_ )
+ for @f;
- or download this
use strict;
my @t=qw(one two three);
...
my %y;
push( @{ $y{ ($a = $_, ( grep {$a=~/\b$_\.ind/} @t )[0] || next)[1] }
+}, $_ ) for @f;
- or download this
for my $f (@f) {
my ($t) = grep {$f=~/$_/} @t;
next unless $t;
push( @{ $y{ $t } }, $f );
}