I get this error while using cookie_jar method:
Can't call method cookie_jar on an undefined value
Here is my code:
my $cookie_jar= new HTTP::Cookies;
my $ua=new LWP::UserAgent;
my %cookies= fetch CGI::Cookie;
my $encoded=$cookies{'SCred'};
$cookie_jar->set_cookie(1, "SCred", $encoded, "/", $SSO_DOMAIN, "", 0, 0, 60*60, 0);
$ua->co...
I need to perform a large number of HTTP post requests, and ignore the response. I am currently doing this using LWP::UserAgent. It seems to run somewhat slow though I am not sure if it is waiting for a response or what, is there anyway to speed it up and possibly just ignore the responses?
...
I'm trying to access a protected file. Server is using digest authentication - which I can see from the printed out response.
Here is the sample code:
use LWP;
use strict;
my $url = 'http://somesite.com/aa/bb/cc.html';
my $username = 'scott';
my $password = 'tiger';
my $browser = LWP::UserAgent->new('Mozilla');
$browser->credentials("...
I'm running 40-or-so threads with the following subroutine:
my $app = shift;
my $ua = LWP::UserAgent->new();
$ua->timeout(5);
my $response = $ua->get($$app{'watch_url'});
my $new_md5;
if ($response->is_success()) {
$new_md5 = md5_hex($response->content());
}
return ($$app{'short_name'}, $$app{'watch_md5'}, $new_md5);
Core dumps en...
I find that the return from LWP::UserAgent->request() contains both the header and body of a HTTP response. I just need the body of the response to do some parsing, so how can I
do?
...
I have a fairly simple perl script with uses the LWP::UserAgent module to follow URLs through redirection to find the final destination URL which it then stores in our MySQL database. The problem is that from time to time the script reports warnings that look like this:
Day too big - 25592 > 24855
Sec too small - 25592 < 74752
Sec too ...
I have a Perl script that uses LWP::UserAgent to download a webpage which it then processes using regular expressions. The problem is that portions of the webpage which are regular HTML aren't being returned to LWP::UserAgent since the site recognizes that the browser doesn't have Flash installed and instead returns HTML prompting us to ...
Example code:
my $ua = LWP::UserAgent->new;
my $response = $ua->get('http://example.com/file.zip');
if ($response->is_success) {
# get the filehandle for $response->content
# and process the data
}
else { die $response->status_line }
I need to open the content as a file without prior saving it to the disk. How would you do ...
i have this code :
use strict;
use LWP::UserAgent;
use warnings;
my $ua = new LWP::UserAgent(agent => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.5) Gecko/20060719 Firefox/1.5.0.5');
$ua->proxy([qw(http https)] => 'http://59.39.92.148:1080');
my $response = $ua->get("http://www.google.com");
print $response->code,' '...
I have a perl CGI application that I want to take the users request headers, and turn those around into an LWP::UserAgent get request. Basically the goal is to replicate the incoming users headers and use those to make a separate request.
I've tried to create the headers myself but when I attempt to display the CGI headers and then my ...
I looked up articles about using LWP however I am still lost! On this site we find a list of many schools; see the overview-page and follow some of the links and get some result pages:
I want to parse the sites using LWP::UserAgent and for the parsing : want to use either HTML::TreeBuilder::XPath or HTML::TokeParser
At the moment I am ...
I have a running LWP::UserAgent that should be applied on following URL:
http://dms-schule.bildung.hessen.de/suchen/suche_schul_db.html?show_school=5503
This runs with many many similar targets see the following endings:
html?show_school=5503
html?show_school=9002
html?show_school=5512
I want to do this with use LWP::UserAgent:
fo...