Skip to main content.
home | support | download

Back to List Archive

Re: pb with http method and perl

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Wed May 22 2002 - 13:40:23 GMT
At 03:50 AM 05/22/02 -0700, BenBen wrote:

What happens when you do this?

> perl -MURI -le 'print URI->new("http://foo.com")->host'   
foo.com

Here's something that's a bit confusing:

> perl -MURI -le 'prin URI->new("http://foo.com")->host'    
Can't locate object method "prin" via package "URI" at -e line 1.


>OK...perhaps...
>could you give me a link to a good URI package,
>please...?


Are you on Windows?  If so you need to use ppm to load modules.

Otherwise: 

Take a look at CPAN.org.  There's the URI module and the LWP bundle.  You
should compare your versions with what are on CPAN.

   http://search.cpan.org/search?dist=libwww-perl  (LWP)
   http://search.cpan.org/search?dist=URI

Note that installing LWP should also install URI, if you use CPAN to install.


For example:
> perl -MLWP -le 'print $LWP::VERSION'
5.60

> perl -MURI -le 'print $URI::VERSION'      
1.15

I just ran this as root:

   perl -MCPAN -e 'install Bundle::LWP'

and after a few minutes and many lines to the screen...

> perl -MLWP -le 'print $LWP::VERSION'
5.64

> perl -MURI -le 'print $URI::VERSION'
1.19


-- 
Bill Moseley
mailto:moseley@hank.org
Received on Wed May 22 13:40:32 2002