This means that (scalar) context will be preserved by ^=~ (and other ^ constructs), correct?
It means that hyperoperators will distribute their own context (whatever it is) to each component of the operation, and then aggregate the results into a list.
For example:
$foo = @bar ^=~ /baz/; # each @bar[$i] =~ /baz in scalar context @foo = @bar ^=~ /baz/; # each @bar[$i] =~ /baz in list context
Hmmmm. That brings up an interesting point though. If the results were aggregated into an array rather than a list, then japhy's greppish interpretation of if (@var ^=~ /baz/) {...} might well be correct, after all.
I'm going to have to thrash this out with Larry. Thanks for raising the issue.
In reply to Re: (tye)Re3: regexp searches over array slices
by TheDamian
in thread regexp searches over array slices
by Reverend Phil
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |