in reply to Re: Date Array Convolution
in thread Date Array Convolution

I think I finally found a way to break the days apart that's a little different than yours:
@combined = sort {$a->[0] <=> $b->[0]} (@listone,@listtwo); for ($i=0; $i<scalar(@combined); $i++) { if (substr($combined[$i][0],0,2) != substr($combined[$i][1],0,2)) + { splice(@combined,$i+1,0,[substr($combined[$i][1],0,2)."0000" +,$combined[$i][1],$combined[$i][2]]); $combined[$i][1] = substr($combined[$i][0],0,2)."2359"; } }
I don't really understand though what you did for the day overlap piece. Do you mind adding comments or explaining the chunks? I'm still kinda new to perl :/

Thanks for the help!

Replies are listed 'Best First'.
Re^3: Date Array Convolution
by choroba (Cardinal) on Nov 03, 2011 at 22:38 UTC
    Your code works only if the day difference is one. My code should work for two, three and more days.
      I completely agree with you that your code is much better than mine! The problem is that I made mine before I saw your post, and also, I'm new enough with perl that I don't really understand everything that's going on in yours. Do you mind adding some comments for the newbie? Thank you for the help!