in reply to regex and matching

Just to satisfy my curiosity, I tested your code against 5.8.8 and 5.10.1 using the re pragma. Under 5.8.8, it doesn't work; however, under 5.10.1, it works. Evidently, the regex engine has improved immensely. Try this and see what the result is:
#!/usr/bin/perl use strict; use warnings; use re qw(debugcolor); my $names = 'Fred Flintstone and Wilma Flintstone'; if ($names =~ m/(?<last_name>\w+) and \w+ \g{last_name}/) { print "I saw $+{last_name}\n"; }