in reply to Re^2: Trouble grepping values when hash contains multiple values per key
in thread Trouble grepping values when hash contains multiple values per key
Is there any way to force grep to evaluate these in a scalar context in order to return a "true" or "false" in this case?
Yes, evaluate grep in scalar context. It's that easy!
my $found_any = grep { ... } @whatever;Boolean context is also a scalar context.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Trouble grepping values when hash contains multiple values per key
by eyepopslikeamosquito (Archbishop) on Jun 06, 2010 at 03:13 UTC |