develooper Front page | perl.perl5.porters | Postings from September 2014

Re: [perl #121638] 'Global symbol "$identifier" requires explicitpackage' error message

Thread Previous | Thread Next
From:
demerphq
Date:
September 16, 2014 21:50
Subject:
Re: [perl #121638] 'Global symbol "$identifier" requires explicitpackage' error message
Message ID:
CANgJU+XUXbax37d7uj0ePB9pVBPytXbPP2DaGBdX3LSJHiP1PQ@mail.gmail.com
On 16 September 2014 22:48, Father Chrysostomos via RT <
perlbug-followup@perl.org> wrote:

> On Mon Sep 15 15:54:34 2014, perl.p5p@rjbs.manxome.org wrote:
> > * Karl Williamson via RT <perlbug-followup@perl.org> [2014-08-
> > 22T16:10:18]
> > > I tried a CPAN smoke of changing this message.  The high level
> > > results are
> > > attached as the first file.
> > >
> > > If I look at the failures, the ones which have the changed wording in
> > > their
> > > test output amount to 130 distinct distributions.  The second
> > > attachment is
> > > an example of an expected failure there.
> >
> > Sigh.  I'm flashing back to when we added a period to Carp's output.
> >
> > I would like to improve this error message, but I think that if we do
> > it by
> > only updating the string, we're going to suffer quite a bit.
> >
> > This is something that could be governed by a pragma, at least until
> > such time
> > as there is a better way to identify internal errors.  Although I am
> > not
> > thrilled at a proliferation of pragmata for things such as this, I
> > think it may
> > be better in the long run.
> >
> > The down side is that now new users will only get the helpful error
> > message if
> > they have done 'use v5.24', or the like, which is a pretty hefty down
> > side.
> >
> > Anybody have a great idea?
>
> I think I have an easy way out for now.  Do what we did for ‘Can’t locate
> Rheubarbarum/Rheubarbarorum.pm in @INC’.  Simply add ‘(Did you forget to
> declare "my $rhubarb"?)’.
>
> As for pragmata changing the wording of error messages, no, please let’s
> not go there.
>
> eval { mumbo_jumbo() }; # What’s that in Latin?
> if ($@ =~ /Old wording/
>  || $@ =~ /New wording/ # Grrr! Some callbacks have ‘use 5.42’
> ) {
>
> What we really need are error codes, though....
>

I have long argued we should do this. It would allow us to localize error
messages without making everyones life painful.

If we agreed that this would be nice to have I would work on it.

Yves

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