in reply to Re: Perl Idioms Explained - !!expr
in thread Perl Idioms Explained - !!expr
I would also mention just a simple ternary operator as an alternative:
or, more generally the equivalent to !!$expr is (some of the parens are optional depending on context):return grep($_ eq $_[0], @_[ 1 .. $#_ ]) ? 1 : '';
(($expr)?1:'')
|
---|
In Section
Tutorials