5 # Produce a page containing all FastCGI inputs
7 # Copyright (c) 1996 Open Market, Inc.
9 # See the file "LICENSE.TERMS" for information on usage and redistribution
10 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
12 # $Id: echo-perl,v 1.1 1997/09/16 15:36:28 stanleyg Exp $
18 my($label, $envp) = @_;
19 print("$label:<br>\n<pre>\n");
20 my @keys = sort keys(%$envp);
21 foreach $key (@keys) {
22 print("$key=$$envp{$key}\n");
27 while (($key, $val) = each %ENV) {
28 $initialEnv{$key} = $val;
31 while(FCGI::accept() >= 0) {
32 print("Content-type: text/html\r\n\r\n",
33 "<title>FastCGI echo (Perl)</title>\n",
34 "<h1>FastCGI echo (Perl)</h1>\n",
35 "Request number ", ++$count, "<p>\n");
36 $len = 0 + $ENV{'CONTENT_LENGTH'};
38 print("No data from standard input.<p>\n");
40 print("Standard input:<br>\n<pre>\n");
41 for($i = 0; $i < $len; $i++) {
44 print("Error: Not enough bytes received ",
45 "on standard input<p>\n");
50 print("\n</pre><p>\n");
52 print_env("Request environment", \%ENV);
53 print_env("Initial environment", \%initialEnv);