5 # Produce a page containing all FastCGI inputs
7 # Copyright (c) 1996 Open Market, Inc.
9 # See the file "LICENSE" for information on usage and redistribution
10 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
12 # $Id: echo.PL,v 1.2 2000/12/14 13:46:23 skimo Exp $
14 # Changed by skimo to demostrate autoflushing 1997/02/19
21 my($label, $envp) = @_;
22 print("$label:<br>\n<pre>\n");
23 my @keys = sort keys(%$envp);
24 foreach my $key (@keys) {
25 print("$key=$$envp{$key}\n");
31 my $req = FCGI::Request(\*STDIN, \*STDOUT, \*STDERR, \%env);
33 while($req->Accept() >= 0) {
34 print("Content-type: text/html\r\n\r\n",
35 "<title>FastCGI echo (Perl)</title>\n",
36 "<h1>FastCGI echo (Perl)</h1>\n",
37 "Request number ", ++$count, "<p>\n");
38 my $len = 0 + $env{'CONTENT_LENGTH'};
40 print("No data from standard input.<p>\n");
42 print("Standard input:<br>\n<pre>\n");
43 for(my $i = 0; $i < $len; $i++) {
46 print("Error: Not enough bytes received ",
47 "on standard input<p>\n");
52 print("\n</pre><p>\n");
54 print_env("Request environment", \%env);
55 print "More on its way ... wait a few seconds\n<BR>\n<BR>";
58 print_env("Initial environment", \%ENV);