in reply to Re: global regex returning a list of arrays?
in thread global regex returning a list of arrays?
DB<41> use List::MoreUtils "part" DB<42> $a=join " ",0..5 DB<43> x part {my $i++/2} $a =~/(\w) (\w)/g 0 ARRAY(0x90c6430) 0 0 1 1 1 ARRAY(0x90c68a0) 0 2 1 3 2 ARRAY(0x90c68b0) 0 4 1 5
but after considering MoreUtils it's only a small step to define a specialized functional solution fold (&) on one's own...
grep { } fold { $a =~/(\w) (\w)/g }.
Cheers Rolf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: global regex returning a list of arrays?
by LanX (Saint) on Feb 20, 2010 at 23:09 UTC | |
by AnomalousMonk (Archbishop) on Feb 21, 2010 at 06:25 UTC |