while (defined (my $line = )) { chomp $line; my @currentline = split /\s+/, $line; $histogram{$_}++ for @currentline; }