@listone = ([010000,010010,2],[010200,010210,5],[012359,020001,3]); @listtwo = ([010005,010015,1],[010207,010211,4]); #### [010000,010004,2] [010005,010015,1] [010200,010206,5] [010207,010211,4] [012359,012359,3] [020000,020001,3] #### @combined = sort {$a->[0] <=> $b->[0]} (@listone,@listtwo); foreach (@combined) { #check for overlapping times and make sure the smallest V time is listed during the overlap piece #XXXXXXX #break the timespans apart if it covers the crossing of a new day #XXXXXXX }