Ask a Question related to PERL Modules, Design and Development.
-
Tulan W. Hu #1
LWP::Head does not give me the last_modified value
I just upgraded from perl 5.6 to perl 5.8.2
and installed libwww-5.76.
I'm wondering what I did wrong to make
LWP::Head gives me undefined value in the last_modified field.
Any suggestions?
My test program is
use LWP::UserAgent;
use LWP::Debug qw(+);
my $ua = new LWP::UserAgent;
my $cmd = "http://localhost/file.html";
my $req = new HTTP::Request('HEAD', $cmd);
my $res = $ua->request($req);
#check the outcome
if ($res->is_success) {
print "Connect successful\n";
print $res->message . "\n" . $res->code . "\n";
print $res->as_string . "\n";
my $ref = $res->last_modified;
print "last_modified $ref\n";
}else {
print "Error: " . $res->status_line . "\n";
}
Tulan W. Hu Guest
-
head do
:confused; Can neone tell me why this isn't working in mx..........it shows this ! ;" ?> got a feeling the escaping isn't right but it's so... -
In over my head
I had somone start a site for me and now I'm trying to finish it. The site currently deals with apointments and work orders for my computer repair... -
Write into <HEAD></HEAD> section?
Is it possible to write into HEAD section, for example to write out a LINK tag? -
[PHP-DEV] [PHP-CVS] cvs: php-src / NEWS /ext/standard basic_functions.c head.c head.h
> As Andi might say: "Why not call this http_headers()?" :) As you can probably guess, my answer to your first question is your second... -
Injecting code into the <head></head> section
Hi All, I have a web user control that, among other things, provides Print this page, and Email this page functionality I have this script that... -
Sisyphus #2
Re: LWP::Head does not give me the last_modified value
Tulan W. Hu wrote:
I take it that used to work on 5.6 ?> I just upgraded from perl 5.6 to perl 5.8.2
> and installed libwww-5.76.
> I'm wondering what I did wrong to make
> LWP::Head gives me undefined value in the last_modified field.
> Any suggestions?
>
> My test program is
> use LWP::UserAgent;
> use LWP::Debug qw(+);
>
> my $ua = new LWP::UserAgent;
> my $cmd = "http://localhost/file.html";
> my $req = new HTTP::Request('HEAD', $cmd);
>
> my $res = $ua->request($req);
>
> #check the outcome
> if ($res->is_success) {
> print "Connect successful\n";
> print $res->message . "\n" . $res->code . "\n";
> print $res->as_string . "\n";
> my $ref = $res->last_modified;
> print "last_modified $ref\n";
> }else {
> print "Error: " . $res->status_line . "\n";
> }
>
>
Your script certainly works for me (giving the last modified time) on
the following:
1) perl 5.6.1 (AS build 626) on Win2k
2) perl 5.8.2 (AS build 808) on Win2k
3) perl 5.8.0 on linux (mdk-9.1)
I'm also running libwww-5.76.
What operating system do you have ?
Cheers,
Rob
--
To reply by email u have to take out the u in kalinaubears.
Sisyphus Guest
-
Tulan W. Hu #3
Re: LWP::Head does not give me the last_modified value
"Sisyphus" <kalinaubears@iinet.net.au>
[snip]I have solaris 8. I tested more on the script after I posted the question.> What operating system do you have ?
I found out it maynot be the problem on my script.
Maybe some web servers just do not return the last_modified field.
Is this true? Maybe I shall ask this question on another group or
some guru here have the answer for me?
Thanks!
Tulan W. Hu Guest



Reply With Quote

