in reply to Keeping a count of matches in a hash that satisfy more than 1 condition
You could use something like this, which is shorter but not necessarily faster.
You could do each count in a fairly succinct one-liner.foreach (keys %file){ $stats{$file{$_}{FILETYPE}}++; $stats{$file{$_}{FILETYPE}."_".$file{$_}{VOICEOVER}}++; } foreach (keys %stats){ print "$_ => $stats{$_}\n"; }
$stats{$file{$_}{FILETYPE}}++ for keys (%file);
|
|---|