my $pat = qr/a/p; 'aaaa' =~ /$pat/g or die; print "MATCH=[${^MATCH}]\n";