|more useful options|
$response->current_age() behaving unexpectedlyby mooseboy (Pilgrim)
|on Dec 21, 2002 at 12:52 UTC||Need Help??|
mooseboy has asked for the wisdom of the Perl Monks concerning the following question:
Was just playing around with some of the code in Sean M Burke's Perl and LWP (nice book, BTW) and encountered some unexpected behaviour with one of the examples from chapter three which uses $response->current_age(). Here's the program:
On my machine (SuSE Linux 8.0, Perl 5.6.1, LWP 5.66), this program outputs "The document is 0 days, 8 hours, 57 minutes, and 28 seconds old."
But according to the HTTP::Response man page, $response->current_age
calculates the "current age" of the response as specified by draft-ietf-http-v11-spec-07 section 13.2.3. The age of a response is the time since it was sent by the origin server. The returned value is a number representing the age in seconds.
I'm puzzled as to why this program does not say the document is 10 seconds old. The only thing I can think of is that the "current age" of the document (about 9 hrs) is roughly the same as the time difference between my location (Austria) and O'Reilly in CA. Could that be the reason, or is it something else entirely?
Thanks in advance, mooseboy