in reply to Grab "as many occurrences as there are" in a long string

See Regexp::Exhaustive. Following up on SuicideJunkie's example, with overlaps:
use Regexp::Exhaustive qw(exhaustive); use Data::Dumper; my $str = "A dun A dun B overlapped B something A again B"; print Dumper [ exhaustive($str => qr/A (.*?) B/) ]; __END__ $VAR1 = [ "dun A dun", "dun A dun B overlapped", "dun A dun B overlapped B something A again", "dun", "dun B overlapped", "dun B overlapped B something A again", "again" ];