#!/usr/local/bin/perl $hdml=1 if ($ENV{HTTP_USER_AGENT} =~ /UP\.Browser/); print "Pragma: no-cache\n"; print "cache-control: no-cache\n"; if ($hdml) { print "Content-type: text/x-hdml\n\n"; print "\n\n"; } else { print "Content-type: text/html\n\n"; print "
\n";
}

foreach (sort(keys(%ENV))) {
    $str = $ENV{$_};
    $str =~ s/&/&/g;
    $str =~ s//>/g;

    print $_, " = ", $str;
    print "
" if ($hdml); print "\n"; } print "
" if ($hdml); print "\n"; foreach (@ARGV) { print $_; print "
" if ($hdml); print "\n"; } print "
" if ($hdml); print "\n"; if ($ENV{REQUEST_METHOD} eq "GET") { foreach (split('&', $ENV{QUERY_STRING})) { print $_; print "
" if ($hdml); print "\n"; } } elsif ($ENV{REQUEST_METHOD} eq "POST") { read(STDIN, $str, $ENV{CONTENT_LENGTH}); foreach (split('&', $str)) { print $_; print "
" if ($hdml); print "\n"; } } if ($hdml) { print "\n\n"; } else { print "
\n"; }