c0ldfire has asked for the wisdom of the Perl Monks concerning the following question:
this script is not running at all and the error i'm getting is:#!/usr/bin/perl use LWP::UserAgent; use HTTP::Response; use HTTP::Request::Common qw(POST); $ua = LWP::UserAgent->new; $ua->agent("Mozilla 8.0..."); $username = "username"; $password = "password"; my $req = (POST 'http://www.domain.com/login.php', ["Username" => "$username", "Password" => "$password"]); $request = $ua->request($req); $content = $request->content; if ($res->is_success) { print ("success"); exit; } else { print ("failure"); }
Can't call method "is_success" on an undefined value at c:\remotelogin.pl line 24.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Remote web form post
by linuxer (Curate) on Aug 20, 2011 at 19:00 UTC | |
by Anonymous Monk on Aug 21, 2011 at 01:19 UTC | |
by linuxer (Curate) on Aug 21, 2011 at 09:59 UTC |