- or download this
while(<DATA>){
chomp;
$hash{$_}++ for split;
}
- or download this
while(<DATA>){ #get a line of text from the DATA area, put it in spec
+ial variable $_
chomp; #remove the "new line" character from the $_ variable
...
$hash{$word}++; #increment the value pointed to by the $hash{
+$word} "key"
}
}
- or download this
board => 1
chalk => 1
...
students => 2
table => 1
teacher => 3
- or download this
foreach $word (sort keys %hash) {
print "$word\n";
...
print "$word\n";
}
}