Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@yukioc
Created April 30, 2011 23:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yukioc/950081 to your computer and use it in GitHub Desktop.
Save yukioc/950081 to your computer and use it in GitHub Desktop.
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