http://qs321.pair.com?node_id=402664


in reply to How do you place words from a sentence into an array?

You are looking for split:

open( FILE, "bingo_in.txt" ) or die $!;
while (<FILE>) {
    # chomp; - isn't needed as pg points out in the node following up.
    my @words = split; #
no arguments: split $_ on white space
    foreach my $word (@words) { ...

Cheers, Sören

Update: chomp-line commented out