Hello IanD, and welcome to the Monastery!
Try this:
14:33 >perl -wE "my $s = 'Australia’s ‘Powder Capital’'; $s =~ tr/‘’/'
+/; say $s;"
Australia's 'Powder Capital'
14:33 >
See tr{}{} in Quote and Quote like Operators.
Update: Likewise,
14:42 >perl -wE "my $t = 'and ... xxx said “This is a fantastic start
+to the season”'; $t =~ tr/“”/\"/; say $t;"
and ... xxx said "This is a fantastic start to the season"
14:43 >
Or combined into one:
14:46 >perl -wE "my $s = qq[Australia’s ‘Powder Capital’\nand ... xxx
+said “This is a fantastic start to the season”]; $s =~ tr/‘’“”/''\"\"
+/; say $s;"
Australia's 'Powder Capital'
and ... xxx said "This is a fantastic start to the season"
14:49 >
Hope that helps,
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Outside of code tags, you may need to use entities for some characters:
| |
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.
|
|