Normally I like to think I can work out what people mean when they don't 
explain it well. This time I just cant make sense of the question. Please 
try to explain the flow eg.
browser click-->web_server1-->perl_script1-->web_server2-->perl_script2
or
ssh server1-->perl_script2

If you're trying to run the script on the host when not launched from the 
web server then yeah you'll get the local hostname because that makes 
sense. If you want something different you'll have to tell it.
EG $ export HTTP_HOST="www.thingamy.com.au"
or something crude like this
HTTP_HOST=`grep "^ServerName" /etc/httpd/conf/httpd.conf| awk '{print 
$2}'`

 On Thu, 27 Nov 2003, Louis wrote:

> Hi Sluggers:
> 
> When I run a script via browser to get the domain name of a website I use
> $ENV{'HTTP_HOST'}.
> 
> How do I get the same domain name from the command line ?
> 
> I have tried
> 
> use Net::Domain qw(hostname hostfqdn hostdomain);
> 
> But the contents of hostdomain is returning the actual server's hostdomain
> portion. What I want is the domain name for the web site where I ran the
> script from that site and not the server's host domain.
> 
> Thanks.
> 
> 

-- 
---<GRiP>---
Electronic Hobbyist, Former Arcadia BBS nut, Occasional nudist, 
Linux Guru, SLUG/AUUG/Linux Australia member, Sydney Flashmobber,
BMX rider, Walker, Raver & rave music lover, Big kid that refuses
to grow up. I'd make a good family pet, take me home today!
        Do people actually read these things?


-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to