It's just a one-liner...
#!/usr/bin/perl # http://perlmonks.org/?node_id=1182397 use strict; use warnings; my @dd = qw/AA JJ CC M 1 1 3 4 D JJ 1 1 D M 3 3 4 D C M 3 3 3 D P Z/; my @results = map [ split ], "@dd" =~ /\bM\b.*?\bD\b/g; use Data::Dumper; print Dumper \@results;
In reply to Re: how extract and group data in a array
by tybalt89
in thread how extract and group data in a array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |