doesn't produce this:$ perl -MData::Dumper -e ' @arr = ("A[TCG]GG 3", "CTG[AA] 4"); @nar = map { #get rid of trailing number my $st = (split(" ",$_))[0]; #replace bracket with S $st =~ s/\[[ATCG]+\]/S/g; } @arr; print Dumper \@nar '
$VAR1 = [ 'ASGG', 'CTGS' ];
In reply to Multiple Transformations with "map" by monkfan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |