in reply to I can't find the IP address!

REMOTE_ADDR should contain the IP address. Check out your values by running this. Note that REMOTE_USER will contain the basic authentication username if it is used. (You know those boxes that come up asking for a username and password. If you login, REMOTE_USER will contain the username you logged in as).

#!/usr/bin/perl -w use strict; print "Content-type: text/html\n\n"; print "$_: $ENV{$_}<br />" for keys %ENV;


If the above content is missing any vital points or you feel that any of the information is misleading, incorrect or irrelevant, please feel free to downvote the post. At the same time, please reply to this node or /msg me to inform me as to what is wrong with the post, so that I may update the node to the best of my ability.

Replies are listed 'Best First'.
Re: I can't find the IP address!
by hacker (Priest) on Jun 22, 2003 at 04:14 UTC
    FORE!

       print map{"$_ is $ENV{$_}\n"} sort keys %ENV;

      Come on now, really.

      print "$_ is $ENV{$_}\n" for sort keys %ENV;

      1 character less, plus it beats the snot out of using map where it is not needed.


      If the above content is missing any vital points or you feel that any of the information is misleading, incorrect or irrelevant, please feel free to downvote the post. At the same time, please reply to this node or /msg me to inform me as to what is wrong with the post, so that I may update the node to the best of my ability.

        Why not needed? map isn't called in void context; on the other hand the for variant calls print repeatedly, while the other invokes it only once. </nitpick>

        Makeshifts last the longest.