Jenda Krynicky wrote:
...
and build a regexp to match the 1-3 characters to replace:
@signs = sort {length($b) <=> length($a)} keys %trans;
Thanks for this priceless construct. It was very helpful indeed.
@signs = map quotemeta($_) @signs;
@signs = map quotemeta($_), @signs; # needed a comma here
$re = join '|', @signs, '.';
and use the regexp to split the text into pieces and transliterate
them.
$text =~ s/($re)/exists($trans{$1}) ? $trans{$1} : $1/geo;
I have confirmed that it works as intended.
HTH, Jenda
Thank you very much.
Chandra
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/