monkfan has asked for the wisdom of the Perl Monks concerning the following question:
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' ];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Multiple Transformations with "map"
by davido (Cardinal) on Nov 26, 2005 at 07:43 UTC | |
by sauoq (Abbot) on Nov 26, 2005 at 13:06 UTC | |
|
Re: Multiple Transformations with "map"
by TedPride (Priest) on Nov 26, 2005 at 15:15 UTC |