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. | [reply] [d/l] [select] |
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.
| [reply] |