in reply to unitialized values - HELP!
Well, if you look at line 57:
55 while ( my ($punctuation, $count) = each(%wordHash) ) 56 { 57 $wordArray[my $i] = "$count\t$punctuation"; 58 $i++; 59 print ("$count\t$charnames{$punctuation}\n"); 60 }
You'll see that in line 57 you declare a variable inside the square brackets of an array access. Each time through the loop you'll get a new $i which, since you haven't initialized it, will have an undefined value. What you probably want is to just push the next value onto @wordArray instead.
|
|---|