in reply to Numeric summarisation from data in a hash?
Suggestion one would be to put the data in an RDMS and extract the data you want using SQL.
Suggestion two would be to use the DBD::RAM module to fake an RDBMS.
Suggestion three would be to use Colin's suggestion. Here's some (untested) code that implements a possible solution.
--my @clips; foreach (keys %file) { push @{$clips[int($file{$_}{VLENGTH})]}, $file{$_}{TITLE}; } foreach (0 .. $#clips) { print "There are ", scalar @{$clips[$_]}, " clips between $_ -", $_ + 1, " mins\n"; } foreach (0 .. $#clips) { print "Names of clips between $_ - ", $_ + 1, " mins: ", @{$clips[$_]}, "\n"; }
|
|---|