in reply to Numeric summarisation from data in a hash?
foreach my $key (keys %file) { push @{$clips[5]}, $file{$key}{TITLE} if $file{$key}{VLENGTH} !~ /0 days 0 hours (\d+) mins/ || $1 >= 5; push @{$clips[$1]}, $file{$key}{TITLE}; } my $names = ''; foreach my $i (0..$#clips-1) { print 'There are ', scalar(@{$clips[$i]}), ' clips between ', $i, '-', $i+1, " mins :\n"; $names .= 'Names of clips between ', $i, '-', $i+1, ' mins: ', join(', ', @{$clips[$i]}), "\n"; } print 'There are ', scalar(@{$clips[5]}), " clips more than 5 mins :\n +\n"; print $names; print 'Names of clips more than 5 mins: ', join(', ', @{$clips[5]}), " +\n";
|
|---|