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
Ruslan Zakirov
September 18, 2012 15:47
Re: Changing the Perl error message when a module is not found
Message ID:
On Mon, Sep 17, 2012 at 1:04 AM, Michael Stapelberg <> wrote:
> Claes Jakobsson <> 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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About