summaryrefslogtreecommitdiff
path: root/t/net/cgi-bin/test
diff options
context:
space:
mode:
Diffstat (limited to 't/net/cgi-bin/test')
-rwxr-xr-xt/net/cgi-bin/test28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/net/cgi-bin/test b/t/net/cgi-bin/test
new file mode 100755
index 0000000..6a1535c
--- /dev/null
+++ b/t/net/cgi-bin/test
@@ -0,0 +1,28 @@
+#!/usr/local/bin/perl
+
+$| = 1;
+print "Content-type: text/plain
+
+";
+
+if (@ARGV) {
+ print "ARGS: ";
+ print join(", ", map { $_ = qq{"$_"} } @ARGV);
+ print "\n\n";
+} else {
+ print "No command line arguments passed to script\n\n";
+}
+
+while (($key,$val) = each %ENV) {
+ print "$key=$val\n";
+}
+
+if ($ENV{CONTENT_LENGTH}) {
+ $len = $ENV{CONTENT_LENGTH};
+ while ($len) {
+ $n = sysread(STDIN, $content, $len, length $content);
+ last unless defined $n;
+ $len -= $n;
+ }
+ print "\nContent\n-------\n$content";
+}