I had a web signup sheet that asked for times a person could start and end working at an event. To fill in the html table, I needed to get an array of times in half hour intervals (inclusive) between the two times. This is how I did it.
while ($current ne $finish) { unless ( $current =~ s/:0/:3/g ) { ( $temp, $trash ) = split /:/, $current, 2; $temp = ($temp == 12)?1:++$temp; $current = $temp . ":00"; } push @values, $current; }