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:
demerphq
Date:
September 17, 2012 03:59
Subject:
Re: Changing the Perl error message when a module is not found
Message ID:
CANgJU+VdzmPPkKnvTjs6ZnabUgMwBHDoTpbRX9+Zj_PfkQR=cA@mail.gmail.com
On 17 September 2012 12:47, demerphq <demerphq@gmail.com> wrote:
> On 17 September 2012 12:39, Michael Stapelberg <p5p@zekjur.net> wrote:
>> Hi demerphq ,
>>
>> demerphq <demerphq@gmail.com> 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
> incantations.
>
> 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.

And of course the flaw in my reasoning here is that this error is
unrelated to the setting of strictures or not. Sorry for the confusion
(and thanks Steffen for pointing it out).

>> 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.

This part I stick with. :-)

Yves


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

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