in reply to Perl Programming Logic

This isn't really a Perl problem, it's a data problem.

You can't really tell how long someone spent reading a web page from looking at logs, in general. The problem is that the log only has the times the browser sent out a GET or POST or other HTTP request, and when the web site responded (generally). You can't tell from that how long someone "interacted" with a site. I can download a Java or Flash game from a site with one GET, then spend several hours playing with nothing getting logged. Similarly, I can retrieve a single page, close the browser, and retrieve another page several hours later. The log can't tell you that I didn't even have the browser open in between those two times.