> perl -we'use strict;use P; my $re = qr{ (\w+) }x; my $dat = "Just another cats meow"; my @matches = $dat =~ /$re/g; P "#matches=%s, matches=%s", scalar(@matches), \@matches; exit scalar(@matches);' output: #matches=4, matches=["Just", "another", "cats", "meow"]