http://www.perlmonks.org?node_id=993506


in reply to Re: hash to count words
in thread hash to count words

So here is what i have for code so far for the hash.

#!/usr/bin/perl -w open (IN, $file) or die "Cannot open file '$file' : $!\n; $line = <IN>; @array = split ( ' ', $line); foreach $word (@array){ $word =~ s/^\w\w//g; $word = lc ($word); print "$word\n";} $hash {$the}++; $hash {$linux}++; $hash {$hello}++;
What am I doing wrong?