Namudril has asked for the wisdom of the Perl Monks concerning the following question:

Greetings! I have learned here how to get an IP-address,
but have not found the REMOTE_ADDR key in %ENV
here's the code of default.asp file:
<%@ LANGUAGE = PerlScript %> <html> <body> <% $Response->Write($ENV{REMOTE_ADDR}); %> </body> </html>
will be thankful for any help

Replies are listed 'Best First'.
Re: Viewing an IP
by Sidhekin (Priest) on Nov 26, 2006 at 10:41 UTC

    The REMOTE_ADDR environment variable is something that (some?) webservers set up for CGI. But you're not using CGI, you're using ASP.

    I don't remember PerlScript too well, but I think you want something like so:

    <%@ LANGUAGE = PerlScript %> <html> <body> <% $Response->Write( $Request->Remote_Host ); %> </body> </html>

    Update: ... or was it $Request->ServerVariables("REMOTE_HOST"), perhaps? Seriously, it's been years ... but you should get the idea.

    print "Just another Perl ${\(trickster and hacker)},"
    The Sidhekin proves Sidhe did it!

      Thanks, Sidhekin!
      your skills are not lost, even through the years (-:
      $Response->Write( $Request->Remote_Host );
      works right