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

Greeting O learned monks ...
coming straight to the problem, I get an error 'Malformed URL' while trying to send a whois request through a proxy, using
$ua->proxy(http => 'http://139.85.249.14:80'); my $req = new HTTP::Request('GET' , '$netgeo->getCountry(202.54.12.30) +')
BTW, Netgeo is a module used to resolve IP addresses by country, etc.... got it from www.caida.org
I suspect it is because of the proto given as HTTP. Pls advise ..
Thanks in advance ...

Replies are listed 'Best First'.
Re: ICMP through proxy
by blakem (Monsignor) on Oct 03, 2001 at 12:16 UTC
    Try removing the ' marks from your last line:
    my $req = new HTTP::Request('GET' , $netgeo->getCountry(202.54.12.30) +);
    As it is, you are attempting to use the literal url '$netgeo->getCountry(202.54.12.30)' which is certainly not what you want.

    -Blake

      Thanks .. it works .. kind of .. This is the value stored in the variable ...
      HTTP::Response=HASH(0x1f59de8)
      The NetGeo returns a hash from which values can be accessed using keywords ... but now, I have the text included. I tried substring, but I am unable to access the values using keywords from the hash as I get an error message. Pls help ..
        You should probably read the documentation on HTTP::Response.
        % perldoc HTTP::Response
        Here is an example taken from it:
        $response = $ua->request($request) if ($response->is_success) { print $response->content; } else { print $response->error_as_HTML; }
        I don't entirely understand your question, but this should get you pointed in the right direction.

        -Blake