in reply to Spanish special characters
I'm just guessing here, but might it be that your text editor and your Perl interpreter disagree on character sets? I've never seen a literal high-bit character (such as ñ) in source code before, which may be coincidence or may not. For a test, why not try replacing the right hand side of each substitution with the escape sequence for the relevant character? That is, change your last substitution to
and so on.s/ñ/\xf1/;
Better yet, though, don't write your own code to do it, use HTML::Entities to decode each string, thus:
Isn't that simpler? :-)#!/usr/bin/perl -w use strict; # you were using strict, weren't you? ;-) use HTML::Entities 'decode'; # snip (your MAIL statements here) for (@L) { print MAIL decode $_; }
While I'm in "use CPAN" mode, I suggest you look at HTML::Parser for the tag-removing regex--parsing HTML (even just taking out tags) with regular expressions is a dangerous idea.
Good luck!
|
|---|