#!/usr/local/bin/perl -w

use strict ;
use List ;

my $listref = &List::new ;
my ($line, $word, @allwords ) ;

while ($line=<>) {
   
   @allwords = split(" ", $line ) ;
  
   foreach $word ( @allwords ) {
    
       my $foundlingRef ; 
       if ( $foundlingRef = $listref->findWord($word) ) {
	  $listref->incrementCount( $foundlingRef ) ;
       }
       else {
	  $listref->addWord( $word ) ;
       }
   }
}

$listref->print ;

