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

[perl #121638] 'Global symbol "$identifier" requires explicit package' error message

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
September 16, 2014 20:48
Subject:
[perl #121638] 'Global symbol "$identifier" requires explicit package' error message
Message ID:
rt-4.0.18-22819-1410900493-1970.121638-15-0@perl.org
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....

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=121638

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