dmtelf has asked for the wisdom of the Perl Monks concerning the following question:
How can I loop through the hash and get a summary of file lengths like this:$file{$pos}{TITLE} = $line; $file{$pos}{SIZE} = $mrounded; $file{$pos}{VLENGTH} = $vlength; # $vlength = "$d days $h hours $m mins $s secs";
The name of the clip would be stored in $file{$pos}{TITLE}There are n clips between 0-1 mins : There are n clips between 1-2 mins : There are n clips between 2-3 mins : There are n clips between 3-4 mins : There are n clips between 4-5 mins : There are n clips more than 5 mins : Names of clips between 0-1 mins: ...... Names of clips between 1-2 mins: ......
I've done this but using a really ugly & *huge* if-else loop (ugh) and think this summarisation could be done in a few lines of code.
Any & all suggestions gratefully received!
dmtelf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Numeric summarisation from data in a hash?
by Corion (Patriarch) on Jul 07, 2000 at 16:24 UTC | |
|
Re: Numeric summarisation from data in a hash?
by ahunter (Monk) on Jul 07, 2000 at 17:58 UTC | |
|
Re: Numeric summarisation from data in a hash?
by davorg (Chancellor) on Jul 07, 2000 at 16:32 UTC | |
|
Re: Numeric summarisation from data in a hash?
by splinky (Hermit) on Jul 07, 2000 at 16:26 UTC | |
|
Re: Numeric summarisation from data in a hash?
by lhoward (Vicar) on Jul 07, 2000 at 16:36 UTC | |
|
RE: Numeric summarisation from data in a hash?
by cds (Sexton) on Jul 07, 2000 at 16:14 UTC | |
by splinky (Hermit) on Jul 07, 2000 at 16:55 UTC | |
by cds (Sexton) on Jul 07, 2000 at 17:02 UTC |