$start = "23:58:45"; $end = "00:01:15"; $key = $start; while ($key ne $end) { print "$key\n"; # perform action on $hash{$key} here ($h, $m, $s) = split(":",$key); (($s +=1) %=60) || (($m +=1) %=60) || (($h +=1) %=24); $key = join(":",map{sprintf("%02d",$_)}($h,$m,$s)); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: time hash keys
by tadman (Prior) on Aug 04, 2001 at 08:41 UTC | |
by bbfu (Curate) on Aug 06, 2001 at 01:18 UTC |