Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Replacing non ascii in string

by Athanasius (Canon)
on Jan 30, 2013 at 04:38 UTC ( #1015957=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    14:33 >perl -wE "my $s = 'Australia’s ‘Powder Capital’'; $s =~ tr/‘’/'
    +/; say $s;"
    Australia's 'Powder Capital'
    14:33 >
  2. or download this
    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 >
  3. or download this
    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 >

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1015957]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (13)
As of 2015-11-30 11:31 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (769 votes), past polls