Hi, =)
I'im a noobi in perl. I try to write a code wich connect me to a website through a proxy and uses some cookies file. Here is the code:
#!/usr/bin/perl -w
use LWP::UserAgent;
use HTTP::Cookies;
die "Example: perl $0 unless @ARGV;
system("color f");
$browser = LWP::UserAgent->new() or die "Could not initialize browser\n";
#On se connecte a notre proxy
$browser->agent('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)');
$browser->proxy('http', '58.30.16.154:80');
#A present on s'occupe de nos cookies
$browser->cookie_jar( HTTP::Cookies->new(file => "cookies.txt"));
#Puis on envoie la requete
$host = $ARGV[0] . "sous_rep1/sous_rep2/";
$res = $browser->request(HTTP::Request->new(GET=>$host));
$answer = $res->content;
But when I execute it, I encounter the following erros:
Use of uninitialized value $scheme in hash element at C:/Users/****/Deskto
p/Icones/ActivePerl-5.10.0.1001-MSWin32-x86-283495/perl/lib/LWP/Protocol.pm line
55.
Use of uninitialized value $scheme in pattern match (m//) at C:/Users/****
/Desktop/Icones/ActivePerl-5.10.0.1001-MSWin32-x86-283495/perl/lib/LWP/Protocol.
pm line 58.
Use of uninitialized value $scheme in concatenation (.) or string at C:/Users/****/Desktop/Icones/ActivePerl-5.10.0.1001-MSWin32-x86-283495/perl/lib/LWP/P
rotocol.pm line 38.
Use of uninitialized value $scheme in string eq at C:/Users/****/Desktop/I
cones/ActivePerl-5.10.0.1001-MSWin32-x86-283495/perl/lib/LWP/UserAgent.pm line 1
95.
I tried to see everywhere on google if I can found a solution, but i wasn't able to find some.
If someone can explain me why i have thoses error mesages, it would be great =). Thank you for reading that thread.
I'im a noobi in perl. I try to write a code wich connect me to a website through a proxy and uses some cookies file. Here is the code:
#!/usr/bin/perl -w
use LWP::UserAgent;
use HTTP::Cookies;
die "Example: perl $0 unless @ARGV;
system("color f");
$browser = LWP::UserAgent->new() or die "Could not initialize browser\n";
#On se connecte a notre proxy
$browser->agent('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)');
$browser->proxy('http', '58.30.16.154:80');
#A present on s'occupe de nos cookies
$browser->cookie_jar( HTTP::Cookies->new(file => "cookies.txt"));
#Puis on envoie la requete
$host = $ARGV[0] . "sous_rep1/sous_rep2/";
$res = $browser->request(HTTP::Request->new(GET=>$host));
$answer = $res->content;
But when I execute it, I encounter the following erros:
Use of uninitialized value $scheme in hash element at C:/Users/****/Deskto
p/Icones/ActivePerl-5.10.0.1001-MSWin32-x86-283495/perl/lib/LWP/Protocol.pm line
55.
Use of uninitialized value $scheme in pattern match (m//) at C:/Users/****
/Desktop/Icones/ActivePerl-5.10.0.1001-MSWin32-x86-283495/perl/lib/LWP/Protocol.
pm line 58.
Use of uninitialized value $scheme in concatenation (.) or string at C:/Users/****/Desktop/Icones/ActivePerl-5.10.0.1001-MSWin32-x86-283495/perl/lib/LWP/P
rotocol.pm line 38.
Use of uninitialized value $scheme in string eq at C:/Users/****/Desktop/I
cones/ActivePerl-5.10.0.1001-MSWin32-x86-283495/perl/lib/LWP/UserAgent.pm line 1
95.
I tried to see everywhere on google if I can found a solution, but i wasn't able to find some.
If someone can explain me why i have thoses error mesages, it would be great =). Thank you for reading that thread.