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 17, 2012 03:47
Re: Changing the Perl error message when a module is not found
Message ID:
On 17 September 2012 12:39, Michael Stapelberg <> wrote:
> Hi demerphq ,
> demerphq <> writes:
>> So then this is an XY problem right?
>> You are asking us to change the error message (X) in an attempt to
>> work around the problem that newbies don't use diagnostics (Y).
>> But instead you should be asking how we can solve Y, which is "how do
>> we make sure that newbies know about and use diagnostics".
> I disagree. Newbies will use the default.

So then they wont see warnings and errors either right? To get errors
you need strict, which has no command line option and is not the
default. To get warnings you need warnings, or -w. (And -w isnt a
replacement for use warnings.) Perhaps in *really* new code the
default is to enable these, but I doubt many newbies do the required

If newbies use "the default" then they neither see errors nor
warnings, and any change to /this/ warning isn't going to help them

If they don't use "the default" then we are  back to square one: which
is figuring out what can we do to make it more obvious to newbies that
using diagnostics is the right thing.

> Otherwise we’d have to publish
> aggressively that you should never use 'perl', but always 'perl
> -Mdiagnostics', and if we were to do that, why wouldn’t we make it the
> default instead?

Well I think you'd get more traction arguing there should be an option
that enabled diagnostics than changing the existing warning messages.

> To address your actual worries about regressions:
> 1. We could make this error message only appear for modern code which
>    includes "use v5.18" (or whenever this might be included).
> 2. We could check if the error message is about to be printed to a TTY
>    (that is, interactively) and only modify it in that case.

Like I said, I really think you are trying to solve the wrong problem here.


perl -Mre=debug -e "/just|another|perl|hacker/"

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