Beefy Boxes and Bandwidth Generously Provided by pair Networks
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 time

by perloHolic() (Beadle)
on Feb 06, 2015 at 12:01 UTC ( [id://1115768]=note: print w/replies, xml ) Need Help??


in reply to Passing epoch time to function to compare open session time and close session time

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}; #interval

which 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....

  • Comment on Re: Passing epoch time to function to compare open session time and close session time
  • Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1115768]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-24 22:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found