Instead, that would be better written as:my @Required = qw( ... ); my @Non_Zero = qw( ... ); unless ((grep { $row->{$_} eq '' } @Required) || (grep { $row->{$_} == 0 } @Non_Zero)) { # Do stuff here with $row now that we have all the # Required and Non_Zero fields verified... } else { &complain($row); }
The first is a crazy way of doing it, but it's what's needed to make it work. I'd much rather have any and all, but I'm not allowed to use them in production code. *pouts*if (all(@{$row}{@Required}) ne '' && all(@{$row}{@Non_Zero}) != 0) { # Do stuff here ... } else { &complain($row); }
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
In reply to Re: Useful uses of Quantum::Superpositions?
by dragonchild
in thread Useful uses of Quantum::Superpositions?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |