Help for this page

Select Code to Download


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