Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: IP Address Quandry

by davis (Vicar)
on Aug 12, 2002 at 09:33 UTC ( [id://189423]=note: print w/replies, xml ) Need Help??


in reply to IP Address Quandry

The server's IP address is stored in an environmental variable - you could use something like the following, extracting only SERVER_ADDR
#!/usr/bin/perl use warnings; use strict; use CGI qw(:standard); print header(); print start_html(-title=>"Environment Variables Test Page"); foreach my $var (sort keys %ENV) { print b($var), " is ", $ENV{$var}, br(); } print end_html();
So, the IP address could be accessed by $ENV{SERVER_ADDR}.
Hope that helps
davis
Is this going out live?
No, Homer, very few cartoons are broadcast live - it's a terrible strain on the animator's wrist

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://189423]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-19 05:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found