Add a line like this:

print "$k $freq{$k}\n";

After this line:

print OUTPUT  "$k $freq{$k}\n";

BTW: Seriously, you don't need the if() statement by the increment.

-----Original Message-----
From: Bruce Ambraal [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 3:00 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Fwd: Split input on whitespace


Could you help me...

With the code below (see attached) I tried to do following:
Read from STDIN, 
splits the input in whitespace, 
and prints the frequency of terms, with each term printed next to its
frequency on STDOUT. 


--------------------------------------------------------------------------------
This email may contain confidential and privileged 
material for the sole use of the intended recipient. 
If you are not the intended recipient, please contact 
the sender and delete all copies.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to