$ cat fluffy.pl use strict; use warnings; my $t = "Now is the time for all good men to come to the aid"; if ($t =~ /^(\w+) (\w+) (\w+) (\w+) (\w+) (\w+)/) { print "Words: 2='$2', 4='$4', 1='$1'\n"; } else { print "*** no match! ***\n"; }