develooper Front page | perl.perl5.porters | Postings from August 2017

[perl #68534] Enhancement: which *expression* (not just scalar) wasuninitialized in eq

Thread Previous | Thread Next
From:
Jader Dias via RT
Date:
August 3, 2017 17:57
Subject:
[perl #68534] Enhancement: which *expression* (not just scalar) wasuninitialized in eq
Message ID:
rt-4.0.24-11387-1501760485-1374.68534-15-0@perl.org
On Fri, 09 Aug 2013 17:22:14 -0700, davidnicol@gmail.com wrote:
> On Fri, Aug 9, 2013 at 7:17 PM, David Nicol <davidnicol@gmail.com>
> wrote:
> 
> >
> >
> > On Thu, Aug 8, 2013 at 7:57 PM, Father Chrysostomos
> >
> >> Note that this already includes the hash element:
> >>
> >> $ perl -we 'my %x; print $x{foo} == 1'
> >> Use of uninitialized value $x{"foo"} in numeric eq (==) at -e line
> >> 1.
> >>
> >>
> 
> > 4: drop the current repetition of a limited class of expressions in
> > favor
> > of two different warnings, the first stating "uninitialized left
> > expression
> > in numeric eq (==) at -e line 1" (could conceivably break something
> > somewhere, if someone somehow is parsing these warnings as part of
> > their
> > very fragile process, but slightly easier to do than option 5, but
> > means
> > discarding perfectly good function)
> > 5: keep what's there now and switch to option-4 style for anything
> > more
> > complicated than what gets displayed now
> >
> 
> option 4 would be easier done by simply inserting "on left" or "on
> right",
> instead of null-string, when the expression is beyond what the warning
> can
> handle.

I would like to upvote this request and the proposed solution #5.

Test script

    $ perl -we'sub a {} sub b {} print a == b'

Current output:

    Use of uninitialized value in numeric eq (==) at -e line 1.

Desired output:

    Use of uninitialized value at the left of numeric eq (==) at -e line 1.

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

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