Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Posts
    2

    Unhappy Unanswered: LWP not work when I get a webpage.

    Hi everyone,
    I would like to using the get command in perl script to get a webpage, for example http://www.google.com/ so that I can parse this result in my script. I also installed libwww-perl-5.69 and libnet-1.16 but they doesn't work. My script likes this:


    #!/usr/bin/perl -w
    use strict;
    use LWP:imple;

    my $content = get("http://www.google.com/");
    print $content;

    if (is_success(getprint("http://www.google.com/"))) {
    print "Connect successed!";
    }

    And this is the result:

    Use of uninitialized value in pattern match (m//) at :/Perl!/site/lib/LWP/Protocol.pm line 114.
    Use of uninitialized value in concatenation (.) or string at C:/Perl!/site/lib/LWP/Protocol.pm line 87.
    Use of uninitialized value in print at a.pl line 6.
    Use of uninitialized value in pattern match (m//) at C:/Perl!/site/lib/LWP/Protocol.pm line 114.
    Use of uninitialized value in concatenation (.) or string at C:/Perl!/site/lib/LWP/Protocol.pm line 87.
    501 Protocol scheme '' is not supported <URL:http://www.google.com.vn/>


    Thanks advance for anyone who help me solve in this case!
    Best regards,

  2. #2
    Join Date
    Aug 2003
    Posts
    11
    try not using strict; LWP _should_ be strict coherent but ive never tested it. If that doesnt work reinstall the LWP module.

  3. #3
    Join Date
    Aug 2003
    Posts
    13
    I'm not sure, but I think part of your problem may be from using double quotes (") around the website instead of single quotes ('). Since variables are treated like variables instead of a $ sign with a name in double wuotes maybe other things are too. For instance, maybe Perl is trying to match something because of the \\ after http: and Perl is probably thinking the . is for conacatenation.

Posting Permissions

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