while (defined (my $line = )) { chomp $line; my @currentline = split /\s+/, $line; $histogram{$_}++ for @currentline; } #### if( exists $histogram{$word} ) { print "Found $word, $histogram{$word} times\n"; } #### use Data::Dumper; __END__ #Result: while ( ) { my @foo = /(\s+)/; print Dumper \@foo; } C:\> test.pl cat food $VAR1 = [ ' ' ];