in reply to positions of all regexp matches

You would have to maintain your own list as you go:

my $check = 'abcdefghijk'; my (@matches_start, @matches_end); for (0 .. 9) { $check =~ /efg/; push @matches_start, $-[0]; push @matches_end, $+[0]; }

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

Note: All code is untested, unless otherwise stated