View Single Post
Old 02-21-2006, 03:13 PM  
CHMOD
Confirmed User
 
CHMOD's Avatar
 
Join Date: Jun 2003
Posts: 1,697
Quote:
Originally Posted by drjones
and you really really really should turn on 'use strict;' and initialize all your variables with the my() function...
I did.
here is the new script :

#############################

#!/usr/bin/perl -wT
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use diagnostics;
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;

$q = CGI->new();
$ua = LWP::UserAgent->new();

$req = POST 'http://maxmind.com:8010/b',
[l => "hgfdgghhh", i => "69.70.92.38" ];

$k = new CGI($ua->request($req)->content);

$region = $k->param( "region" );
$city = $k->param( "city" );
$country = $k->param( "country" );

print "Content-type: text/html\n\n";
print "$region\n";
exit;

################################
CHMOD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote