On Fri, 12 Jul 2002, Eugene van der Pijll wrote:

> The parentheses around a return only one match, regardless of the number
> within the {}.

Ahh, right.  Sigh, I need to do a limited m//g type of thing, so I guess
I'm stuck with something like:

$_ = "2aaa";
@d = s/^(\d+)//;
push @d, m/(a)/ for 1..$d[0];

My "real" application is something like:

$_ = "Here are 15 interesting values to parse: 12.3 14 acd  3.14 ...";
# try to fill @d with 15 things in one step:
if (@d = m/^Here are (\d+) .*? to parse:(?:\s*(\S+)){\1}/) {
  # do stuff with @d;
}

Yes, I realize there are easy ways to accomplish what I want, but that's
not fun with perl, is it?

-Aaron

Reply via email to