( my $new = reverse $string ) =~ tr/atgc/tacg/; print "$new\n";
Update: Also if you want to remove any non a, t, c or g characters:
( my $new = reverse $string ) =~ tr/atgc\0-\277/tacg/d; print "$new\n";
In reply to Re: char substitution without regexes
by jwkrahn
in thread char substitution without regexes
by biohisham
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |