LWP::Head does not give me the last_modified value

Ask a Question related to PERL Modules, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. Write into <HEAD></HEAD> section?
      Is it possible to write into HEAD section, for example to write out a LINK tag?
    4. [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...
    5. 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...
  3. #2

    Default Re: LWP::Head does not give me the last_modified value

    Tulan W. Hu wrote:
    > 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";
    > }
    >
    >
    I take it that used to work on 5.6 ?
    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

  4. #3

    Default Re: LWP::Head does not give me the last_modified value

    "Sisyphus" <kalinaubears@iinet.net.au>
    [snip]
    > What operating system do you have ?
    I have solaris 8. I tested more on the script after I posted the question.
    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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139