--- projects/cms/source/host/ihost-perl/ihost.pl 2001/11/19 15:07:56 1.38 +++ projects/cms/source/host/ihost-perl/ihost.pl 2001/11/19 22:31:18 1.40 @@ -8,7 +8,7 @@ # a typical Unix/Linux box. # # $Author: tdb $ -# $Id: ihost.pl,v 1.38 2001/11/19 15:07:56 tdb Exp $ +# $Id: ihost.pl,v 1.40 2001/11/19 22:31:18 tdb Exp $ #------------------------------------------------------------ $| = 1; @@ -277,6 +277,9 @@ sub send_udp_packet() { push(@data, "packet.attributes.type=data"); push(@data, "packet.attributes.ip=$ip"); + # sort the data + @data = sort(@data); + # turn the array into some nice XML my($xml) = &make_xml("", ""); @@ -399,7 +402,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; @@ -415,7 +418,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 {