- or download this
while (<STDIN>) {
$some_hash{$_}++;
}
- or download this
foreach (keys %some_hash) {
...some code here...
}
- or download this
my $position = 1;
while (<STDIN>) {
$myhash{$_}{'item'}++;
$myhash{$_}{'position'} = $position++ if ! exists $myhash{$_}{'pos
+ition'};
}