pennypiper
asked on
perl lwp question on windows
Hello,
I've just installed ActivePerl on a windows 2000 machine. When I run "c:\perl -v" it returns v5.8.4. If I run "c:\perl -MLWP -le "print(LWP->VERSION)" it returns 5.79. And when I run "c:\perl -MURI -le "print $URI::VERSION" it returns 1.30.
However, when I run the following program:
use Strict;
use warnings;
use LWP;
my $browser = LWP::UserAgent->new();
my $response = $browser->get("http://www.oreilly.com/");
print $response->header("Server" ), "\n";
(from the book "Perl & LWP") I receive the following error:
"c:\perl -w example.pl"
Can't locate object method "new" via package "LWP::userAgent" (perhaps you forgot to load "LWP::userAgent"?) at example.pl line 7
If I change the code to "use LWP::UserAgent;" I still get the same error.
Could it be a path problem perhaps?
Thanks!
I've just installed ActivePerl on a windows 2000 machine. When I run "c:\perl -v" it returns v5.8.4. If I run "c:\perl -MLWP -le "print(LWP->VERSION)" it returns 5.79. And when I run "c:\perl -MURI -le "print $URI::VERSION" it returns 1.30.
However, when I run the following program:
use Strict;
use warnings;
use LWP;
my $browser = LWP::UserAgent->new();
my $response = $browser->get("http://www.oreilly.com/");
print $response->header("Server"
(from the book "Perl & LWP") I receive the following error:
"c:\perl -w example.pl"
Can't locate object method "new" via package "LWP::userAgent" (perhaps you forgot to load "LWP::userAgent"?) at example.pl line 7
If I change the code to "use LWP::UserAgent;" I still get the same error.
Could it be a path problem perhaps?
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER