ly, 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...
, 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
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.
--
To unsubscribe, e-ma
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.
--- Begin Message ---
Why does my code not write the splitted words t
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 wor
TECTED]; [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 = ) {
foreach my $w ( split( /\s+/, $line ) ){
if( exists $freq
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 = ) {
foreach my $w ( split( /\s+/, $line ) ){
if( exists $freq{$w} ){
$freq{$w}++;
}else{
$freq{$w} = 1;