I need some sample code for a perl script?

print "Content-type: text/html\n\n";

print <<EOM;

<h1>CGI Debugging</h1>

<h2>Server Environment Variables</h2>

<dl>

<dt> SERVER_SOFTWARE <dd> $ENV{SERVER_SOFTWARE}

<dt> SERVER_NAME <dd> $ENV{SERVER_NAME}

<dt> GATEWAY_INTERFACE <dd> $ENV{GATEWAY_INTERFACE}

<dt> SERVER_PROTOCOL <dd> $ENV{SERVER_PROTOCOL}

<dt> SERVER_PORT <dd> $ENV{SERVER_PORT}

<dt> REQUEST_METHOD <dd> $ENV{REQUEST_METHOD}

<dt> HTTP_ACCEPT <dd> "$ENV{HTTP_ACCEPT}"

<dt> PATH_INFO <dd> $ENV{PATH_INFO}

<dt> PATH_TRANSLATED <dd> $ENV{PATH_TRANSLATED}

<dt> SCRIPT_NAME <dd> $ENV{SCRIPT_NAME}

<dt> QUERY_STRING <dd> $ENV{QUERY_STRING}

<dt> REMOTE_HOST <dd> $ENV{REMOTE_HOST}

<dt> REMOTE_ADDR <dd> $ENV{REMOTE_ADDR}

<dt> REMOTE_USER <dd> $ENV{REMOTE_USER}

<dt> AUTH_TYPE <dd> $ENV{AUTH_TYPE}

<dt> CONTENT_TYPE <dd> $ENV{CONTENT_TYPE}

<dt> CONTENT_LENGTH <dd> $ENV{CONTENT_LENGTH}

EOM



foreach $key (sort grep(/^HTTP_/, keys %ENV)) {

print "<dt> $key <dd> $ENV{$key}\n";

}

print "</dl>\n";

@keys = keys %in;

if ($#keys >= 0) {

print "<h2>Form info</h2>\n<dl>\n";

foreach $key (sort @keys) {

print "<dt> $key <dd> $in{$key}\n";

}

}

print "</dl>\n";

print "<h1>Raw form data</h1>\n<pre>$in</pre>\n";

Add Feedback