in reply to Re: hash initialisation
in thread hash initialisation
(A useful trick I have put to good use in the past.)foreach my $month ('02'..'03') { my $m_bucket = $bucket{$month} = {}; foreach my $day ('00' .. $mons{$month}) { my $d_bucket = $m_bucket->{$day} = {}; foreach my $hour ('00'..'23') { my $h_bucket = $d_bucket->{$hour} = {}; foreach my $minute ('00'..'59') { $h_bucket->{$minute} = [0,0]; } } } }
|
|---|