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
Claes Jakobsson
September 16, 2012 13:21
Re: Changing the Perl error message when a module is not found
Message ID:
On 16 sep 2012, at 21:07, Michael Stapelberg <> wrote:
> Hey,
> I’ve been dealing with people who have little to no experience with
> Perl over several years. A very common problem for people who are new to
> Perl is to figure out why a Perl script does not work when it spits
> something in their face along the lines of
>    Can't locate LWP/ 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.
> Therefore, as a first step to help people with it, I’ve created
> where I can point people to when they
> encounter this problem and ask for help.
> However, it’d be much better to make Perl itself say something more
> helpful in that situation (many people don’t even ask for support and
> just give up).
> Therefore, what do you think about changing the Perl error message when
> modules are not found to something like this?
>    ERROR: Could not load Perl module LWP::UserAgent
>    I looked for LWP/ in these paths (@INC):
>    /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
>    Try installing LWP::UserAgent, for example with cpan -i
>    LWP::UserAgent

Changing this quite critical error message format will break peoples code. Tools that checks logs, dependency checkers and perhaps even one or two CPAN clients. At least I had code at a previous job that matched against it and I'm sure others have too.

If this error is going to change I suggest only appending information after it.

however I'm not in favor of changing it as it to me is short and concise.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About