in reply to substitute using a hash
or...foreach (keys %iso8859) { $str =~ s/$_/$iso8859{$_}/g; }
This one would be useful if you only have iso8859 values for *some* hex characters. You can do without that block on the right side (and the trailing /e as well) if you make sure that every value in the range given on the left side is defined in the hash and has a value. For example:$str =~ s/([\xA0-\xFF])/{$iso8859{$1} ? $iso8859{$1} : $1 }/ge;
HTH,$str =~ s/([\xA0-\xA6])/$iso8859{$1}/g;
Mephit (who's learning things as of late by offering replies)
|
|---|