#!c:\perl\bin\perl.exe # This script dumps the environment variables in HTML format use strict; use warnings; sub readproperties($) { my ($propfile) = @_; my (%props); # Return value: a hash of property values. my ($ln,$name,$value,@nv); open(PROPFILE,"$propfile") or die "Unable to open $propfile"; while ($ln = ) { chomp $ln; $ln =~ s/#(.*$)//; # Remove line comments in the properties file. # if ($1 ne "") { print "# $1\n"; } ### DEBUG ### @nv = split /s*=/,$ln,2; $value = pop @nv; $value =~ s/^s*=?s*//; $value =~ s/s*$//; $name = pop @nv; $name =~ s/^s*//; $name =~ s/s*$//; if ($name ne "") { $props{$name} = $value; # print "$name=$value\n"; ### DEBUG ### } } close(PROPFILE); return %props; } print "Content-type:text/html\n\n"; my %properties = readproperties("content.conf"); my $mode = $properties{'defaultProto'}; print "\n"; print "\n"; print "\n"; print "\n"; if ($mode eq "tcp") { print "TCP
\n"; print "UDP
\n"; } else { print "TCP
\n"; print "UDP
\n"; } print "\n"; print "\n";