in reply to Playing with extended chars
My recommendation is to use perl 5.8.0 or more recent and look at perldoc Encode, perldoc open, and perldoc -f open. If tr doesn't work because you have the characters encoded in two bytes, you can do
$s = decode_utf8($s);
That will convert the string into the internal representation where characters are characters and you don't have to worry about how many bytes they need for encoding.
The first attemp works like this:
perl -e '$_="áéíóú";tr/áéíóú/aeiou/;print'
BTW, encode and decode functions return values that make me think that the string is well formed, and that is tr// who's making wrong things. Am I too lost?
$s = 'holÃ¡Ã©ÃÃ³Ãºon';
$s =~ tr/Ã¡Ã©ÃÃ³Ãº/aeiou/;
# prints holaeiouon
Read a book on Perl
Written a book on Perl
Contributed to the Perl source code
Debugged someone else's script
Played Perl Golf
Used regular expressions to save the day
Used Perl for a certain amount of time (please specify)
Invested a certain amount of man-hours in learning Perl (please estimate)
Visited at least x Perl related events
(Co)maintain at least x active (up-river) CPAN modules
Forgotten you were not Larry Wall
One can never truly know Perl
Results (335 votes). Check out past polls.