in reply to Re: converting smart quotes
in thread converting smart quotes

my $content = LWP::UserAgent->new->get($url)->content; utf8::decode($content);
can be replaced with
my $content = LWP::UserAgent->new->get($url)->decoded_content;

Replies are listed 'Best First'.
Re^3: converting smart quotes
by tobyink (Canon) on Mar 20, 2012 at 00:51 UTC

    In this case, yes, but decoded_content does a lot of other stuff besides. Also I wanted the OP to have a better idea of what's going on - that when Perl gets data from the outside world it's often in bytes, which need decoding into Perl's native Unicode representation.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

      In this case, yes, but decoded_content does a lot of other stuff beside

      Stuff that must be done, such as removing compression when used.