in reply to (tye)Re: regexp searches over array slices
in thread regexp searches over array slices
Well, Perl 6 will let you do:so, in Perl 6, will that mean "and" or "or"?if (@array[3,4] ^=~ /\S/) { ... }
Neither. It's exactly the same as: if (@array[3] =~ /\S/, @array[4] =~ /\S/) { ... }
which is true if @array[4] contains any non-whitespace.
That is, I recall ^=~ being able to work over a list, but what will if do with the resulting list?
Just what a Perl 5 if does with it.
In other words, does it become this (a grep-ish map)?
No, I don't believe so.
BTW, what you're looking for is: if (any(@array[3,4]) =~ /\S/) {...} or: if (all(@array[3,4]) =~ /\S/) {...} both of which (I'm very hopeful) will be standard in Perl 6.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: (tye)Re: regexp searches over array slices
by japhy (Canon) on Nov 09, 2001 at 19:49 UTC | |
by tilly (Archbishop) on Nov 09, 2001 at 22:15 UTC | |
|
(tye)Re3: regexp searches over array slices
by tye (Sage) on Nov 09, 2001 at 20:36 UTC | |
by TheDamian (Vicar) on Nov 11, 2001 at 02:20 UTC | |
by tye (Sage) on Nov 12, 2001 at 02:59 UTC | |
by TheDamian (Vicar) on Nov 15, 2001 at 01:09 UTC | |
by tye (Sage) on Nov 15, 2001 at 01:40 UTC | |
|