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:
Michael Stapelberg
Date:
September 16, 2012 14:04
Subject:
Re: Changing the Perl error message when a module is not found
Message ID:
x6ipbdd6if.fsf@midna.zekjur.net
Hi Claes,

Claes Jakobsson <claes@surfar.nu> writes:
> 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.
Ugh, I feared that someone might really have code which depends on
this. I don’t really understand why they don’t just eval "use <module>"
and see if that works correctly. Is there any advantage in actually
parsing the error message?

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

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.


-- 
Best regards,
Michael

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