Gunnar Hjalmarsson wrote:
sivasakthi wrote:
I have passed the one URL to cgi script , and i have retrieve the values
by using the param method..
the example url is following ,
http://172.16.2.30:2004/block/blocked.cgi?url=google.com&target=gambling
now i wanted to retrieve the host of
http://172.16.2.30:2004/block/blocked.cgi .. how i can able to get that?
my $hostname =
( gethostbyaddr pack('W4', split /\./, '172.16.2.30'), 2 )[0];
Or maybe you are simply looking for the CGI variable $ENV{HTTP_HOST} ...
Or do you just want
my ($host) = $uri =~ m#://(.+?)[:/]#;
Your initial post leaves room for various interpretations. :)
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/