in reply to Re^2: Grep-Ternary Operator Question
in thread Grep-Ternary Operator Question
Note the lack of 'first' and 'end' in the output.
my $string = qq! first ! . (grep /blivitz/, @array) ? qq! yes ! : qq! no ! . qq! end !;
is
my $string = ( qq! first ! . (grep /blivitz/, @array) ) ? ( qq! yes ! ) : ( qq! no ! . qq! end ! );
You removed a set of parens. See the update I made at the same time you were posting.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Grep-Ternary Operator Question
by ww (Archbishop) on Oct 05, 2010 at 23:32 UTC |