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:
David Golden
Date:
September 16, 2012 13:22
Subject:
Re: Changing the Perl error message when a module is not found
Message ID:
CAOeq1c8kiMWcomUq6DAiv8cB27UoRKDCmoiUWxOFDJOpDzeCkQ@mail.gmail.com
On Sun, Sep 16, 2012 at 3:07 PM, Michael Stapelberg <p5p@zekjur.net> wrote:
> 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/UserAgent.pm 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

I support changing the error to have the module name -- but I'm not
sure if that's technically possible as I think the module name might
be converted to a path during compilation and then you can't reverse
any relative path at runtime because someone might actually call C<<
require 'Foo/Bar.pm' >> and it wouldn't be right to say "could not
load Foo::Bar" in that case.

If it's possible, go for it!

David


-- 
David Golden <xdg@xdg.me>
Take back your inbox! → http://www.bunchmail.com/
Twitter/IRC: @xdg

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