in reply to chomp each element of array

From the docs:
perldoc -f chomp chomp( LIST ) If you chomp a list, each element is chomped, ...