Slightly OT, but if you have a lot of such character-for-character translation to do (a bio-app?), consider using tr/// instead of s/// (pattern substitution) for faster operation (see tr/// in Quote-Like Operators in perlop):
c:\@Work\Perl\monks>perl -wMstrict -le "my $s = 'xxxDxUxxDDxxUUxDUDxUDUx'; print qq{'$s'}; ;; $s =~ tr/DU/M/; print qq{'$s'}; " 'xxxDxUxxDDxxUUxDUDxUDUx' 'xxxMxMxxMMxxMMxMMMxMMMx'
In reply to Re: OT: Why is my result empty?
by AnomalousMonk
in thread Why is my result empty?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |