Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to read user's IP adress with Perl?

0 views
Skip to first unread message

Marthan

unread,
Mar 8, 2008, 3:51:30 AM3/8/08
to
how to read user's IP adress with Perl?

Marhan


Frank Seitz

unread,
Mar 8, 2008, 4:00:13 AM3/8/08
to
Marthan wrote:
> how to read user's IP adress with Perl?

Hm, for me, a network interface has an ip address, not a user.

Frank
--
Dipl.-Inform. Frank Seitz; http://www.fseitz.de/
Anwendungen für Ihr Internet und Intranet
Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel

Message has been deleted

Marthan

unread,
Mar 8, 2008, 4:23:48 AM3/8/08
to
OK I want read: IP Address properties of user's Internet Connection

"Frank Seitz" <devnu...@web.de> wrote in message
news:63f2svF...@mid.individual.net...

Frank Seitz

unread,
Mar 8, 2008, 4:36:15 AM3/8/08
to
Marthan wrote:
> OK I want read: IP Address properties of user's Internet Connection

http://kuerzer.de/cookbook_receipe17.7

Message has been deleted

Frank Seitz

unread,
Mar 8, 2008, 4:45:14 AM3/8/08
to
Marthan wrote:
> OK I want read: IP Address properties of user's Internet Connection

Google: "identifying the other end of a socket"

Gunnar Hjalmarsson

unread,
Mar 8, 2008, 5:17:48 AM3/8/08
to
Marthan wrote:
> 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}.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

Joe Smith

unread,
Mar 9, 2008, 8:07:20 AM3/9/08
to
Marthan wrote:
> OK I want read: IP Address properties of user's Internet Connection

What kind of internet connection?

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

Uri Guttman

unread,
Mar 9, 2008, 9:27:48 AM3/9/08
to
>>>>> "JS" == Joe Smith <j...@inwap.com> writes:

JS> Marthan wrote:
>> OK I want read: IP Address properties of user's Internet Connection

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

--
Uri Guttman ------ u...@stemsystems.com -------- http://www.sysarch.com --
----- Perl Architecture, Development, Training, Support, Code Review ------
----------- Search or Offer Perl Jobs ----- http://jobs.perl.org ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------

vikram

unread,
Mar 10, 2008, 1:33:23 AM3/10/08
to
On Mar 8, 1:51 pm, "Marthan" <mart...@csv.t-portal.cc> wrote:
> how to read user's IP adress with Perl?
>
> Marhan

Hi,

(\d)\.(\d)\.(\d)\.(\d)

represents the ipaddress.

Bye
vikram

John W. Krahn

unread,
Mar 10, 2008, 9:03:42 AM3/10/08
to
vikram wrote:
> On Mar 8, 1:51 pm, "Marthan" <mart...@csv.t-portal.cc> wrote:
>> how to read user's IP adress with Perl?
>
> (\d)\.(\d)\.(\d)\.(\d)
>
> represents the ipaddress.

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


John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall

Ted Zlatanov

unread,
Mar 10, 2008, 10:52:09 AM3/10/08
to
On Mon, 10 Mar 2008 13:03:42 GMT "John W. Krahn" <som...@example.com> wrote:

JWK> vikram wrote:
>> On Mar 8, 1:51 pm, "Marthan" <mart...@csv.t-portal.cc> wrote:
>>> how to read user's IP adress with Perl?
>>
>> (\d)\.(\d)\.(\d)\.(\d)
>>
>> represents the ipaddress.

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

0 new messages