
$TYPE = "\U$ARGV[0]";

$BASE_DIR        = $ENV{SERVER_WWW_HOME};
$BASE_HREF       = $ENV{SERVER_WWW_URL};
$SERVER_NAME     = $ENV{SERVER_NAME};
$SERVER_HOME     = $ENV{SERVER_HOME};
$ENV{BACKGROUND} = "BGCOLOR='$ENV{SERVER_WWW_BACKGROUND}'";

$TEMPLATE = `cat $ENV{SERVER_LIB}/cgi/nph-solver-sample.cgi`;
$TEMPLATE =~ s/<WEB_PERL>/$ENV{SERVER_WEB_PERL}/g;
$TEMPLATE =~ s/<SERVER_HOME>/$SERVER_HOME/g;
$TEMPLATE =~ s/<SERVER_NAME>/$SERVER_NAME/g;
$TEMPLATE =~ s/<SERVER_USER>/$ENV{SERVER_USER}/g;
$TEMPLATE =~ s/<SERVER_HOSTNAME>/$ENV{SERVER_HOSTNAME}/g;
$TEMPLATE =~ s/<SERVER_BIN>/$ENV{SERVER_BIN}/g;
$TEMPLATE =~ s/<SERVER_CGIS>/$ENV{SERVER_CGI_HOME}/g;
$TEMPLATE =~ s/<SERVER_VAR>/$ENV{SERVER_VAR}/g;
$email = $ENV{SERVER_EMAIL};
$email =~ s/\@/\\@/g;
$TEMPLATE =~ s/<SERVER_EMAIL>/$email/g;
$admail = $ENV{SERVER_ADMIN};
$admail =~ s/\@/\\@/g;
$TEMPLATE =~ s/<SERVER_ADMIN>/$admail/g;
$TEMPLATE =~ s/<SERVER_CGI_LIB>/$ENV{SERVER_CGI_LIB}/g;
$TEMPLATE =~ s/<BASE_DIR>/$BASE_DIR/g;
$TEMPLATE =~ s/<BASE_HREF>/$BASE_HREF/g;
$TEMPLATE =~ s/BGCOLOR/$ENV{BACKGROUND}/g;
print $TEMPLATE;


