Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Does LWP::Simple not work with internal web sites?

I'm trying to connect to our local server's web site and parse it but it keeps coming back empty. Does LWP::Simple automatically add the www. to the domain name? That would explain why I keep getting an uninitialized value error.

Any ideas on how to get this to work?

Thank you.

#!/usr/bin/perl use warnings; use strict; use LWP::Simple; my $appeals = get('http://server24/ASD/Administrator/AllRequests.aspx? +CatID=24&CatName=Employees'); print $appeals; # comes back empty

Replies are listed 'Best First'.
Re: Parsing an intranet web page
by Anonymous Monk on Jul 01, 2009 at 16:06 UTC
    Does LWP::Simple automatically add the www. to the domain name?

    No.

    LWP::Debug

    use LWP::Simple '$ua'; $ua->add_handler("request_send", sub { shift->dump; return }); $ua->add_handler("response_done", sub { shift->dump; return }); my $appeals = get(...
Re: Parsing an intranet web page
by mzedeler (Pilgrim) on Jul 01, 2009 at 21:43 UTC

    Try using LWP::UserAgent and look at the response code.

Re: Parsing an intranet web page
by poolpi (Hermit) on Jul 02, 2009 at 08:52 UTC

    Do you need to set a proxy?
    See lwpcook/proxies

    $ua->env_proxy; # initialize from environment variables # or $ua->proxy(ftp => 'http://proxy.myorg.com');


    hth,
    PooLpi

    'Ebry haffa hoe hab im tik a bush'. Jamaican proverb