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:
Jesse Luehrs
Date:
September 16, 2012 14:12
Subject:
Re: Changing the Perl error message when a module is not found
Message ID:
20120916211222.GJ11137@tozt.net
On Sun, Sep 16, 2012 at 11:04:08PM +0200, Michael Stapelberg wrote:
> 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?

Needing to handle the case of "module doesn't exist" and "module has
errors" differently is fairly common. I really don't like the idea of
"we can't ever change the format of our error messages because people
might be relying on it", but it is true that as it stands currently,
this change would break a non-trivial amount of code (base.pm is one
example I can think of off the top of my head).

(Why don't we have real exception objects yet?)

-doy

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