Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: How can I get user's IP using Perl?

by cwest (Friar)
on Jul 20, 2000 at 22:24 UTC ( [id://23457]=note: print w/replies, xml ) Need Help??


in reply to How can I get a remote user's IP using Perl?

$ENV{REMOTE_ADDR}
For that matter, you could use remote_host() from CGI.pm.

Also, try this:

#!/usr/bin/perl -w use strict; $|++; use CGI; my $cgi = CGI->new; print $cgi->header, $cgi->start_html, $cgi->pre( ( map { "$_\t$ENV{$_}\n" } keys %ENV ) ), $cgi->end_html;
That was untested, but I'm pretty sure it's right :-)

Replies are listed 'Best First'.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://23457]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-03-29 11:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found