No such thing as a small change | |
PerlMonks |
Re: loop issueby Kenosis (Priest) |
on Aug 10, 2012 at 03:52 UTC ( [id://986652]=note: print w/replies, xml ) | Need Help?? |
I don't know whether this will help, but notice the following transitional segment in the CDR data:
Line D is 3600 seconds short of the pattern which your script implements, so it's creating entries from E on, based upon the assumption that entries are always 86400 seconds apart. Line D appears to be an outlier that's caused this problem. This would also account for the two different loops producing the same result. Given the above, perhaps this will work on your particular data set (untested, so please use with caution):
This adds a conditional check for an entry only 82800 seconds beyond the previous entry, and then adjusts $loopTime down by 3600 seconds if found. (This downward adjustment will cause the outlier value to be looked at again, but it seems more readable to do this than to add 169200 (86400*2-3600) to $loopTime to skip over the outlier to the next entry.) Continuing to add 86400 to $loopTime within the loop should then work after the adjustment. Hope this helps!
In Section
Seekers of Perl Wisdom
|
|