Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
cgi environment values
#!/usr/bin/env perl
print "Content-Type: text/html\n\n";
print "<html><body><table border='1'>";
print "<tr><th>$_</th><td>$ENV{$_}</td></tr>" for (sort(keys(%ENV)));
print "</table></body></html>";
#!/usr/bin/env python
import os
print "Content-Type: text/html\n"
print "<html><body><table border='1'>"
for k,v in sorted(os.environ.iteritems()):
print "<tr><th>%s</th><td>%s</td></tr>" % (k,v)
print "</table></body></html>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment