in reply to hash to count occurences

The "secret sauce" is in the line such as $myhash->{'mykey'}++. Welcome to what Perl calls "auto-vivification." If a hash-entry does not yet exist, it will be created with the initial value of 1. If it does exist, it will be incremented. So you can write this one statement to "do what you want."

After looping through all the data, iterate through the keys in the hash and look for values greater than 15.

Replies are listed 'Best First'.
Re^2: hash to count occurences
by LanX (Saint) on Oct 25, 2013 at 19:42 UTC
    almost

    > If a hash-entry does not yet exist, it will be created with the initial value of 1.

    the initial value is undef, when incremented undef is interpreted as 0.

    Cheers Rolf

    ( addicted to the Perl Programming Language)