my %H; while (<>) { my ( $word, $freq ) = split /\s+/, $_; $word = lc( $word ) ; $H{ $word } += $freq ; }