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.
What am I doing wrong?#!/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}++;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: hash to count words
by NetWallah (Canon) on Sep 13, 2012 at 15:46 UTC | |
by AnomalousMonk (Archbishop) on Sep 13, 2012 at 16:18 UTC | |
by underoathed (Initiate) on Sep 17, 2012 at 12:59 UTC | |
by AnomalousMonk (Archbishop) on Sep 17, 2012 at 19:52 UTC |
In Section
Seekers of Perl Wisdom