use strict; my (@list) = map { /\w+\s+\w+\s+\w+\s+\w+\s+\w+\s+(\w+)\s+.*/} ; print "@list"; __DATA__ 1 2 3 4 5 6 7 8 james joe jack janet jill joann joeanne bill bob alice joe jack janet jill alice joeanne bill bob james joe jack janet jill susan joeanne bill bob james joe jack janet jill sarah joeanne bill bob james joe jack janet jill ethel joeanne bill bob