good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Passing epoch time to function to compare open session time and close session timeby perloHolic() (Beadle) |
on Feb 06, 2015 at 12:01 UTC ( [id://1115768]=note: print w/replies, xml ) | Need Help?? |
Given the above suggestions from NetWallah and Corion, it would also help to include an example of your log files, or at least a few lines of one, to help with understadning what you want to do and what you want to do it with. I have made a little start on shaping up your code to compile under warnings and strict, which it now does, but without an example of input, the output of the script is ambigous at best. Update the post to include an effort at addressing NetWallah and Corion's suggestions as well as posting up some input/expected output examples and I (And many others besides) will be more than happy to help, I'm sure. All the best. EDIT:After further testing with some sample data I mocked up for test case purposes, I believe the problem with getting '0's for everything is that your current calculations are base upon the $epoch variable - Which by my tests show that: $openTime{$ID} = $epoch;AND $closeTime = $epoch;produce the same number given that: my $duration = $closeTime - $openTime{$ID}; #intervalwhich is affectively $epoch minus $epoch = '0' This summation is however subject to my current knowledge of things and any corrections are obviously more than welcome, and hopefully this helps a little more with getting you to your solution....
In Section
Seekers of Perl Wisdom
|
|