I replied:
: Dan Egli wrote:
: : It's odd tho. I type:
: :
: : perl -MCPAN -e 'install GD' and it works fine. Only with thinks like
: : HTTP::Date and Data::Dumper does it work. I'm not sure whats up.
:
: 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
This is similar to when you do stuff like "my $cgi = new CGI;":
you're calling the new() method in the CGI package.
So if you'd had HTTP::Date already installed, and it had a sub in it
named "install", the command line would have run that instead of the
"install" imported from CPAN.
There must be a moral in there somewhere... ;)
-- tdk