in reply to Can my perl scripts get the IP address that called the script?
isn't always defined, depending on VPN, proxies, etc.
Second, you were seeking an IP- $ENV{REMOTE_HOST} is a name, which can presumably resolve to an IP, but the same network restrictions may apply for both.
Last,
probably uses %ENV as well, so the IP may or may not be defined.my $q = new CGI; my $userIP = $q->remote_addr();
in the simple-case, you MAY be able to get the IP. In a secure corporate case like ours, it dubious. I suspect the replies that stated use $ENV{REMOTE_ADDR} only use this on simple networks. In my world and perhaps yours, things just aren't that easy;I wish they we're since this *simple* IP is in-fact a major PAIN for us.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Can my perl scripts get the IP address that called the script?
by Fletch (Bishop) on Apr 13, 2022 at 15:03 UTC |