for (0 .. 23) { my $count = $byhour{$_} || 0; print "$_ had $count\n"; }