use strict; my @lines = ; chomp @lines; foreach (@lines) { my @words = split " ", $_; print "\$_: '$_'\n"; foreach (@words) { print "'$_' "; } print "\n\n"; } __DATA__ Delimit each word with one or more spaces This is the second line