in reply to Re: transliteration d flag not working as expected
in thread transliteration d flag not working as expected
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'
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: transliteration d flag not working as expected
by LanX (Sage) on Jun 09, 2013 at 12:29 UTC | |
by AnomalousMonk (Archbishop) on Jun 09, 2013 at 13:14 UTC |
In Section
Seekers of Perl Wisdom