try Apache->request->get_server_name instead of hostname()
it's cheaper too, since Sys::Hostname::hostname forks, at least once
per-process.  not so bad if you call it in the parent though (in a
PerlRequire script), then all children have the cached results

On Wed, 3 Nov 1999, Nick Urbanik wrote:

> Dear folks,
> 
> When I run a CGI program as such, hostname works.  When I run it under
> Aapche::Registry, it fails.   Can anyone understand why?  Sorry, I am
> new to all this.
> 
>  [error] Cannot get host name of local machine at
> /home/httpd/dbi/frame_control.cgi line 13
> 
> use Sys::Hostname;
> 
> my $hostname = hostname();
> my $URL = "http://$hostname/dbi/";
> 
> --
> Nick Urbanik, Dept. of Electrical & Communications Engineering
> Hong Kong Institute of Vocational Education (Tsing Yi)
> email: [EMAIL PROTECTED], [EMAIL PROTECTED]
> Tel:   (852) 2436 8660, (825) 2436 8674   Fax: (852) 2436 8643
> pgp ID: 7529555D fingerprint: 53 B6 6D 73 52 EE 1F EE EC F8 21 98 45 1C 23 7B
> 
> 
> 

Reply via email to