Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re^6: Closure warning with Perl 5.14?

by John M. Dlugosz (Monsignor)
on May 19, 2011 at 13:41 UTC ( #905697=note: print w/replies, xml ) Need Help??

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

That was a hack for getting state variables. So it might be found in code that should use state instead, and won't work as expected in the new versions.

Replies are listed 'Best First'.
Re^7: Closure warning with Perl 5.14?
by JavaFan (Canon) on May 19, 2011 at 13:59 UTC
    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.

      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?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2021-12-02 15:51 GMT
Find Nodes?
    Voting Booth?
    R or B?

    Results (22 votes). Check out past polls.