#Initial code... @array = (['EMBL','a','b'],['c','d'],['EMBL','e','f']); $list = join "\n", map {${$_}[1],${$_}[2]}grep { ${$_}[0] eq "EMBL" } @array; print $list; #first step convert the ${$_}[$index] to $_->[$index] $list = join "\n", map { $_->[1],$_->[2] } grep { $_->[0] eq "EMBL" } @array; #second step convert to list slice $list = join "\n", map { @{$_}[1,2] } grep { $_->[0] eq "EMBL" } @array; #next step simplify map{}grep{} into just map{} $list = join "\n", map { $_->[0] eq "EMBL" ? @{$_}[1,2] : () } @array; print "\nSimplified:\n$list";