Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^7: Closure warning with Perl 5.14?

by JavaFan (Canon)
on May 19, 2011 at 13:59 UTC ( [id://905703]=note: print w/replies, xml ) Need Help??


in reply to Re^6: Closure warning with Perl 5.14?
in thread Closure warning with Perl 5.14?

Yeah, but what is the intention of all other code that uses:
my $var if COND;
? Either the if COND is redundant, because it's always true, or it maybe false and you have the same issue. Also,
my $var = 0 if 0;
creates a "state" variable, yet there's no warning.

Now, I'm usually not a fan of adding a warning for every little thing, but if there's a warning, it shouldn't be inconsistent on when it warns and when it doesn't.

Replies are listed 'Best First'.
Re^8: Closure warning with Perl 5.14?
by John M. Dlugosz (Monsignor) on May 19, 2011 at 14:05 UTC
    Oh well.

    I agree with your sentiment.

    We could speculate about some code path or another that the warning was added to. But in general, if it was added to some specific code path in the perl implementation, it was either (1)he was working in that part of the code and added the warning because he could, (2) that specific path is one that changed its behavior under that circumstance, or (3) adding it there as opposed to systematically was low-hanging fruit.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://905703]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2025-03-26 15:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (68 votes). Check out past polls.

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.