while ( ) { my $line = $_; my ($word) = split /\s/, $line; print $word, "\n"; }