how to read user's IP adress with Perl?

G

Gunnar Hjalmarsson

Marthan said:
OK I want read: IP Address properties of user's Internet Connection

If you by "read" mean "find out what it is", and assuming you run a CGI
script, you may be looking for the environment variable $ENV{REMOTE_ADDR}.
 
U

Uri Guttman

JS> What kind of internet connection?

JS> There are different answers, depending on how the connection comes
JS> in to your server. HTTP, FTP, TELNET, SSH, BitTorrent, Skype,
JS> etc, etc, etc.

actually from the tcp/ip perspective those are all the exact same
thing. sockets are sockets and you can get all the IP info you want
about a peer socket. the difference you claim is in the data protocol
that runs on top of the socket layer (including any encryption).

uri
 
T

Ted Zlatanov

JWK> 66.94.234.13 is a valid IP address which won't be matched by that pattern.

You should at least mention Regexp::Common if you're correcting an IP
address pattern. I know the original question was not about that, but
it's still better to make a useful reply than just to point out a
counter-example.

Ted
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,173
Latest member
GeraldReund
Top