--- projects/cms/source/host/ihost-perl/ihost.pl 2001/11/19 17:43:00 1.39 +++ projects/cms/source/host/ihost-perl/ihost.pl 2001/11/20 12:47:03 1.41 @@ -8,7 +8,7 @@ # a typical Unix/Linux box. # # $Author: tdb $ -# $Id: ihost.pl,v 1.39 2001/11/19 17:43:00 tdb Exp $ +# $Id: ihost.pl,v 1.41 2001/11/20 12:47:03 tdb Exp $ #------------------------------------------------------------ $| = 1; @@ -47,7 +47,11 @@ $seq_no = 1; $retry_wait = 60; # write our PID to a file -$pidfile = "/var/tmp/ihost.pid"; +# use home dir by default +$pidfile = $ENV{"HOME"}; +# or drop it in /var/tmp if we can't find HOME +$pidfile = "/var/tmp" if not defined $pidfile; +$pidfile .= "/.ihost.pid"; &write_pid(); &tcp_configure(); @@ -402,7 +406,7 @@ sub write_pid() { sub make_xml() { my($curlevel, $curline) = @_; my($xmltemp) = ""; my($curtag) = ""; my($attributes) = ""; - while(true) { + while(1) { $curline = shift(@data) if $curline eq ""; chomp $curline; if($curline =~ /^$curlevel([^\.\s]+\.)/) { $curtag=$1; @@ -418,7 +422,7 @@ sub make_xml() { } my($nextline) = $data[0]; chomp $nextline if defined $nextline; $curtag =~ s/(.*)\./$1/; - if(defined $nextline && $nextline =~ /^$curlevel$curtag\./) { + if((defined $nextline) && ($nextline =~ /^$curlevel$curtag\./)) { $curline = ""; } else {