in reply to global regex returning a list of arrays?
Perhaps more scalable, but still involving an explicit loop:
>perl -wMstrict -le "use List::MoreUtils qw(natatime); use Data::Dumper; my $s = 'ab123cd456ef789gh'; my $triad = natatime 3, $s =~ m{ (\d) (\d) (\d) }xmsg; while (my @three = $triad->()) { print Dumper \@three; } " $VAR1 = [ '1', '2', '3' ]; $VAR1 = [ '4', '5', '6' ]; $VAR1 = [ '7', '8', '9' ];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: global regex returning a list of arrays?
by LanX (Saint) on Feb 20, 2010 at 22:25 UTC | |
by LanX (Saint) on Feb 20, 2010 at 23:09 UTC | |
by AnomalousMonk (Archbishop) on Feb 21, 2010 at 06:25 UTC |