At 02:15 PM 6/1/01 -0400, Timothy Kimball wrote:
>: I get the same result with Data::Dumper & 5.6.0 unless I quote
>: the module name:
>:
>: perl -MCPAN -e 'install "Data::Dumper"'
>
>To elaborate, now that I've had a minute to think about it: when perl
>sees "install GD", it takes "GD" as a bareword (i.e., an unquoted
>string) and runs the "install" imported from CPAN.  However, in
>"install Data::Dumper" or "install HTTP::Date", Perl cannot interpret
>the module name as a bareword because it has punctuation in it ("::").
>So it thinks you're doing an indirect sub call; that is, it sees this:
>
>         install HTTP::Date
>
>as thinks you want this:
>
>         HTTP::Date::install

Well I'll be hornswoggled.  What you say is entirely reasonable, and now I 
find I can reproduce the problem, but yet observe:

We have a totally modern perl:
         % perl -v
         This is perl, v5.6.1 built for sun4-solaris-2.5.1
We have HTTP::Date:
         % perl -MHTTP::Date -e 0
         %
We also have Net::SSLeay (to take a lexically similar module):
         % perl -MNet::SSLeay -e 0
         %
Which we could reinstall if we wanted:
         % perl -MCPAN -e 'install Net::SSLeay'
         CPAN: Storable loaded ok
         Going to read /afs/jpl/group/fil/uai/perlnew/cpan/Metadata
         ^C
And yet:
         % perl -MCPAN -e 'install HTTP::Date'
         Can't locate object method "install" via package "HTTP::Date"
         (perhaps you forgot to load "HTTP::Date"?) at -e line 1.

Okay, I geddit... it's because HTTP::Date is required by CPAN.pm (perldoc 
-m CPAN | grep -i http).  So perl sees the module name as being one it 
already knows of and turns it into the indirect object syntax as you say.

Worth documenting in CPAN.pm, perhaps.  I'll copy the author.



--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com

Reply via email to