$string = "A Perl among Camels"; $string =~ /(((\w+) (\w+)) ((\w+) (\w+)))/g; print "1 is '$1'\n 2 is '$2'\n 3 is '$3'\n 4 is '$4'\n 5 is '$5'\n 6 is '$6'\n 7 is '$7'\n";