in reply to Re^2: nonempty false list
in thread nonempty false list
if( grep $_, @opts{qw|a b c|}) { }
A cleaner version of this would be
if( grep $opts{$_}, qw|a b c|) { }
You can use a couple negations to check if all values are true:
if( !grep !$opts{$_}, qw|a b c|) { }
Note that your second suggestion will always return true, since you will always have a 3-element array in scalar context.
|
|---|