It is not clear for me what you want to accomplish, but generally use HTML::Entities to process html entities:
use strict;
use warnings;
use HTML::Entities;
my $line="” 3”";
decode_entities ($line);
If this module is of no help, please, try to give a step backwards and explain the kind of conversions you want to be done
Update: A closer look at your code reveals that you are not using alternation correctly: [] in a regexp is a character class, but probably you are wanting () instead (see perlretut and perlre):
$line="” 3 ”";
$line =~ s/(?:&|&\;)rdquo;/'/g;
print "$line\n";
That prints:
' 3 '
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.