Because you don't have any print statements to STDOUT?

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


Why does my code not write  the splitted words to STDOUT? 

#!/usr/bin/perl -w
open (OUTPUT, ">ex92.out")||die;
my %freq;
while (my $line  = <STDIN>) {
    foreach my $w ( split( /\s+/, $line ) ){
        if( exists $freq{$w} ){ 
            $freq{$w}++; 
        }else{
            $freq{$w} = 1;
        }
    }
print "\n";
exit if $line eq "q\n";
}
foreach my $k ( keys( %freq ) ){
    print OUTPUT  "$k $freq{$k}\n";
} 

close (OUTPUT);


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


--------------------------------------------------------------------------------
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