You could also do it with a single s/// substitution, although it is messier and almost certainly slower than a double-tr/// approach:
>perl -wMstrict -le "my %xlate = qw(t f h l i i s p); ;; my $s = 'alters'; $s =~ s{ . }{ $xlate{${^MATCH}} // '' }xmsgpe; print qq{'$s'}; " 'fp'
In reply to Re^2: transliteration d flag not working as expected
by AnomalousMonk
in thread transliteration d flag not working as expected
by SamCG
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |