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:
Ruslan Zakirov
Date:
September 18, 2012 15:47
Subject:
Re: Changing the Perl error message when a module is not found
Message ID:
CAMOxC8t5wh-DTyv5d7oMtJoqgM+HhM8R8Sx=EA+QifEGVaUThw@mail.gmail.com
On Mon, Sep 17, 2012 at 1:04 AM, Michael Stapelberg <p5p@zekjur.net> wrote:
> 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?

1) Optional dependencies. It happened several times that CPAN or
system's packager say that module is installed, but an optional
feature doesn't work. So we hide "Can't locate ...", but warn on
anything else to give something to start debugging problem.

2) We use overlays for modules, eg for X::Y load X::Y_Local. Again,
it's ok if it's missing, but rethrow error otherwise.

Regexps are anchored with ^, but will work if something appended to the message.

As I recall UNIVERSAL::require does error parsing as well.

-- 
Best regards, Ruslan.

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