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
September 18, 2012 02:27
Re: Changing the Perl error message when a module is not found
Message ID:
Nicholas Clark writes:

> On Tue, Sep 18, 2012 at 07:23:14AM +0100, Smylers wrote:
> > As a non-novice, I'd still be grateful for the error message to
> > include the Module::Name rather than just Module/ Apart from
> > anything else it makes it copy-and-pastable to, for example, a cpanm
> > command -- even though that isn't always what I want to do.
> That's the one change that I think it would be unambiguously useful to
> add. However, it's not trivially obvious how to do it, as the
> conversion from Module::Name to Module/ is done at compile time
> ...

I think the suggestion was simply for it to be converted back again in
the error message: if the file not found ends in .pm then lop that off
the end and replace /s with ::s.

This would mean it shows even in situations where somebody had done
require 'Some/' -- but that's a much rarer case and somebody
doing that is more likely to know what she's doing and realize that
Some::File doesn't apply.


New series of TV puzzle show 'Only Connect' (some questions by me)
Mondays at 20:30 on BBC4, or iPlayer:

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About