A
Andrew
Hello,
I am learning Perl and I have come across something I dont understand.
I have put together some code from examples and I see something
strange between data returned from HTTP and HTTPS sites. When I run
my script on a non secured site (http://www.yahoo.com for example) I
get connection info and page source. When I run the same script on a
HTTPS site (https://www.helsinki.fi/) I get the connection info, but
it returns an empty <HTML></HTML> bracket. Can anyone explain to me
why this is occuring in this script?
#!/usr/bin/perl
use warnings;
use strict;
use LWP;
use HTTP::Cookies;
use HTML:
arser ();
my $browser = LWP::UserAgent->new();
my $cj = HTTP::Cookies->new(file
=>"/home/awilhite/perl/cookies.lwp",autosave => 1,);
$browser->proxy(['http','https'],'Edited_ContainsMyProxyInfo');
$browser->cookie_jar($cj);
my $req = HTTP::Request->new(GET => "$ARGV[0]");
my $res = $browser->request($req);
if ($res->is_success) {
print $res->as_string;
#print $res->content;
} else {
print "Failed: ", $res->status_line, "\n";
}
I am learning Perl and I have come across something I dont understand.
I have put together some code from examples and I see something
strange between data returned from HTTP and HTTPS sites. When I run
my script on a non secured site (http://www.yahoo.com for example) I
get connection info and page source. When I run the same script on a
HTTPS site (https://www.helsinki.fi/) I get the connection info, but
it returns an empty <HTML></HTML> bracket. Can anyone explain to me
why this is occuring in this script?
#!/usr/bin/perl
use warnings;
use strict;
use LWP;
use HTTP::Cookies;
use HTML:
my $browser = LWP::UserAgent->new();
my $cj = HTTP::Cookies->new(file
=>"/home/awilhite/perl/cookies.lwp",autosave => 1,);
$browser->proxy(['http','https'],'Edited_ContainsMyProxyInfo');
$browser->cookie_jar($cj);
my $req = HTTP::Request->new(GET => "$ARGV[0]");
my $res = $browser->request($req);
if ($res->is_success) {
print $res->as_string;
#print $res->content;
} else {
print "Failed: ", $res->status_line, "\n";
}