how to read user's IP adress with Perl?

Discussion in 'Perl Misc' started by Marthan, Mar 8, 2008.

  1. Marthan

    Marthan Guest

    how to read user's IP adress with Perl?

    Marhan
     
    Marthan, Mar 8, 2008
    #1
    1. Advertising

  2. Marthan

    Marthan Guest

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

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

    "Frank Seitz" <> wrote in message
    news:...
    > 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
     
    Marthan, Mar 8, 2008
    #2
    1. Advertising

  3. Re: OK I want read: IP Address properties of user's Internet Connection

    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
     
    Gunnar Hjalmarsson, Mar 8, 2008
    #3
  4. Marthan

    Uri Guttman Guest

    Re: OK I want read: IP Address properties of user's InternetConnection

    >>>>> "JS" == Joe Smith <> 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 ------ -------- 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 ---------
     
    Uri Guttman, Mar 9, 2008
    #4
  5. Marthan

    vikram Guest

    On Mar 8, 1:51 pm, "Marthan" <-portal.cc> wrote:
    > how to read user's IP adress with Perl?
    >
    > Marhan


    Hi,

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

    represents the ipaddress.

    Bye
    vikram
     
    vikram, Mar 10, 2008
    #5
  6. vikram wrote:
    > On Mar 8, 1:51 pm, "Marthan" <-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
     
    John W. Krahn, Mar 10, 2008
    #6
  7. Marthan

    Ted Zlatanov Guest

    On Mon, 10 Mar 2008 13:03:42 GMT "John W. Krahn" <> wrote:

    JWK> vikram wrote:
    >> On Mar 8, 1:51 pm, "Marthan" <-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
     
    Ted Zlatanov, Mar 10, 2008
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bk
    Replies:
    0
    Views:
    482
  2. Jarod_24

    adress of server

    Jarod_24, Apr 2, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    332
    Jarod_24
    Apr 2, 2004
  3. Jarod_24

    adress of project folder

    Jarod_24, Apr 3, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    335
    Jarod_24
    Apr 5, 2004
  4. hpber
    Replies:
    2
    Views:
    293
    Marcus Kwok
    Jul 5, 2007
  5. Stefan Falk

    Getting E-Mail-Adress of User in a Web Service

    Stefan Falk, Dec 22, 2003, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    119
    Chris S
    Dec 24, 2003
Loading...

Share This Page