in reply to calculating peak hour

From the comments so far, I gather that what you're looking for is the maximum number of 'start-to-end' time periods which are in progress within your dataset. This is easily calculated, given that the number of open time periods increments at each @start time and decrements at each @end time:
my @proc_start = sort @start; my @proc_end = sort @end; my $count = 0; my $max = 0; while (@proc_start && @proc_end) { if ($proc_start[0] lt $proc_end[0]) { # Next event is a start $count++; $max = $count if $count > $max; shift @proc_start; } else { # Next event is an end $count--; shift @proc_end; } } print "Peak was $max\n";
(Untested code. Assumes that the time period covered by the dataset begins and ends with 0 open periods. Hour-to-hour transitions are left as an exercise for the reader.)