develooper Front page | perl.perl5.porters | Postings from September 2012

Re: Changing the Perl error message when a module is not found

Thread Previous | Thread Next
From:
Johan Vromans
Date:
September 16, 2012 23:31
Subject:
Re: Changing the Perl error message when a module is not found
Message ID:
m28vc9rwih.fsf@phoenix.squirrel.nl
Michael Stapelberg <p5p@zekjur.net> writes:

> My new proposal is this:
>
>     Can't locate LWP/UserAgent.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.12.4
> /usr/local/share/perl/5.12.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.12
> /usr/share/perl/5.12 /usr/local/lib/site_perl .) at -e line 1. 
>     BEGIN failed--compilation aborted at -e line 1.
>
>     ERROR: Could not load Perl module LWP::UserAgent
>
>     Try installing LWP::UserAgent from your distribution or via
>     CPAN. Run 'perldoc perlmodinst' for more information.

To a novice this might give the impression there are three errors.

   ERROR: Could not load Perl module LWP::UserAgent
   Can't locate LWP/UserAgent.pm in @INC (@INC contains: ...) at -e line 1. 
   BEGIN failed--compilation aborted at -e line 1.
   Try installing module LWP::UserAgent from your distribution or
   via CPAN. Run 'perldoc perlmodinst' for more information.

Note that the 2nd line, which is searched for by many tools, is
unmodified.

-- Johan

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About