in reply to Re: An error message to understand
in thread An error message to understand

And since the pattern can never match the empty string, or 0, you could skip the define and write:
foreach (@CHOICE) { if ($_ && /.../) { ... } }
Or:
foreach (@CHOICE) { $_ or next; if (/.../) { ... } }
if all you have inside the foreach is the if statement.
Perl --((8:>*

Replies are listed 'Best First'.
Re^3: An error message to understand
by tirwhan (Abbot) on Jan 06, 2006 at 12:29 UTC

    I don't particularly want to argue about it but I would not approve of such a change. True, as the pattern match is now it does not make a difference, but if the pattern is ever changed it's easy to miss changing the test as well, which can introduce a subtle bug. Just checking for truth makes the code more brittle. IMO, YMMV, etc.


    There are ten types of people: those that understand binary and those that don't.