in reply to Really Odd Bug With LWP and Device::SerialPort
What version of perl? On 5.8.8, I get:
On 5.14, I get:use strict; use warnings; my $url='https://github.com'; use LWP::UserAgent; use Encode qw(is_utf8); use Data::Dumper; my $useragent = LWP::UserAgent->new(); my $request = new HTTP::Request; $request->method("GET"); $request->url($url); my $response = $useragent->request($request); my $data = $response->decoded_content(); print "1: ",is_utf8($data),"\n"; $data = substr($data,0); print "2: ",is_utf8($data),"\n"; # Prints: 1: 1 2:
1: 1 2: 1
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Really Odd Bug With LWP and Device::SerialPort
by kschwab (Vicar) on Aug 08, 2013 at 18:02 UTC | |
by runrig (Abbot) on Aug 08, 2013 at 21:07 UTC | |
by kschwab (Vicar) on Aug 08, 2013 at 21:47 UTC | |
by runrig (Abbot) on Aug 09, 2013 at 16:43 UTC | |
by kschwab (Vicar) on Aug 09, 2013 at 18:25 UTC |
In Section
Seekers of Perl Wisdom