in reply to Meta Redirects and CGI

Probably the easiest way to grab the IP address is:

#!/usr/bin/perl -w
use CGI;
my $cgi = new CGI;
my $ip = $cgi->remote_host();

print "Content-Type: text/html\r\n\r\n";
print "<html><body>Your IP address is $ip.</body></html>";