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:
Mark Overmeer
Date:
September 17, 2012 01:03
Subject:
Re: Changing the Perl error message when a module is not found
Message ID:
20120917080257.GM1197@moon.overmeer.net
* Michael Stapelberg (p5p@zekjur.net) [120917 07:49]:
> >    Can't locate LWP/UserAgent.pm in @INC (@INC contains: ...) at -e line 1. 
> 
> How about this instead?
> 
>     Can't locate LWP/UserAgent.pm in @INC (@INC contains: ...)
>     BEGIN failed--compilation aborted at -e line 1.
> 
>     The above error is most likely caused by Perl not finding the module
>     LWP::UserAgent. Try installing LWP::UserAgent from your distribution
>     or via CPAN. Run 'perldoc perlmodinst' for more information.


  use diagnostics;

    (F) You said to do (or require, or use) a file that couldn't be
    found. Perl looks for the file in all the locations mentioned in @INC,
    unless the file name included the full path to the file.  Perhaps you
    need to set the PERL5LIB or PERL5OPT environment variable to say where
    the extra library is, or maybe the script needs to add the library name
    to @INC.  Or maybe you just misspelled the name of the file.  See
    perlfunc/require and lib.

Perl's errors do not explain how to get resolved, unless you flag
"diagnostics".

Is this case so special?  Developers know what it this error means.
End-users should report it to the package maintainer as bug-report,
so do not need to be able to resolve this by themselves.
-- 
Regards,

               MarkOv

------------------------------------------------------------------------
       Mark Overmeer MSc                                MARKOV Solutions
       Mark@Overmeer.net                          solutions@overmeer.net
http://Mark.Overmeer.net                   http://solutions.overmeer.net


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