From: Joe Van Dyk Date: 2006-09-13T06:57:47+09:00 Subject: getting the last word in each line Is there a prettier way to read a file and return the last word in each line? Here's my go: File.read(some_file).to_a.map { |l| line.split.last } What if I wanted to search the lines (based on a regex) and return the last word in each line that satisfied the search criteria? Joe