Plankton has asked for the wisdom of the Perl Monks concerning the following question:
... error messages. My script (with exception) of the shebag is taken directly from the Synopsis section of LWP::UserAgent on CPAN (see below):Can't locate object method "get" via package "LWP::UserAgent" (perhaps + you forgot to load "LWP::UserAgent"?) at ./download.pl line 8.
Do I need to something funky with my @INC? Or is my Perl version too old ...#!/usr/local/iXSD/perl/bin/perl require LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->timeout(10); $ua->env_proxy; my $response = $ua->get('http://search.cpan.org/'); if ($response->is_success) { print $response->content; # or whatever } else { die $response->status_line; }
Thanks!$ perl -version This is perl, v5.6.1 built for i686-linux ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can't locate object method "get" via package "LWP::UserAgent"
by almut (Canon) on Oct 17, 2007 at 00:41 UTC | |
by Anonymous Monk on Oct 17, 2007 at 06:35 UTC | |
by almut (Canon) on Oct 17, 2007 at 12:27 UTC | |
by Plankton (Vicar) on Oct 18, 2007 at 00:03 UTC | |
|
Re: Can't locate object method "get" via package "LWP::UserAgent"
by Gangabass (Vicar) on Oct 17, 2007 at 00:41 UTC |