Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

can't install URI from CPAN

by tos (Deacon)
on Jul 04, 2003 at 11:29 UTC ( [id://271455]=perlquestion: print w/replies, xml ) Need Help??

tos has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

there were no problems installing f.i. Image::Size directly form CPAN

# perl -MCPAN -e 'install Image::Size' Going to read /home/tos/.cpan/sources/authors/01mailrc.txt.gz CPAN: Compress::Zlib loaded ok ... (and so on) ... /usr/bin/make install -- OK
but with URI, i also tried "bundle", i only get
# perl -MCPAN -e 'install URI' Can't locate object method "install" via package "URI" (perhaps you fo +rgot to load "URI"?) at -e line 1.
What i'm doing wrong ?

thanks in advance, tos

Replies are listed 'Best First'.
Re: can't install URI from CPAN
by Tomte (Priest) on Jul 04, 2003 at 13:45 UTC

    'install URI' collides with one form to call a method in perl, what happens here, shows '-MO=Deparse' (Thanks and ++ to jeffa for pointing this out in the undef var thread, a new tool in my ever growing perl-box):

    ~> perl -MO=Deparse -MCPAN -e "install URI::URL" use CPAN; 'URI::URL'->install; -e syntax OK
    and, as is often the case, a unary + corrects the compilers perspective:
    ~> perl -MO=Deparse -MCPAN -e "install +URI::URL" use CPAN; install('URI::URL'); -e syntax OK

    regards,
    tomte


    Hlade's Law:

    If you have a difficult task, give it to a lazy person --
    they will find an easier way to do it.

Re: can't install URI from CPAN
by gjb (Vicar) on Jul 04, 2003 at 11:43 UTC

    I'm not really sure what happens, but quoting URI solves the problem:

    perl -MCPAN -e 'install "URI"'

    Hope this helps, -gjb-

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://271455]
Approved by gjb
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-03-28 22:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found