in reply to Howto count elements within an interval

Something like:
use YAML; my %count_per_100k; while (<DATA>) { my ($text, $count) = split; next unless $text =~ /gene/; $count_per_100k{int($count / 100_000)}++; } print Dump \%count_per_100k; __DATA__ ...
Output:
--- 0: 14 1: 18 2: 1
At least, I think that's your question. Perhaps you want to do something different.

Replies are listed 'Best First'.
Re^2: Howto count elements within an interval
by lomSpace (Scribe) on Nov 05, 2010 at 18:18 UTC
    JavaFan,
    That is the answer to my questions. Also, any advice on getting a better
    grip on the power of hashes?

    Thanks!
    LomSpace