4 print OUT "#!$Config{perlpath}\n";
5 print OUT while <DATA>;
7 chmod 0755, "echo.fpl";
12 # Produce a page containing all FastCGI inputs
14 # Copyright (c) 1996 Open Market, Inc.
16 # See the file "LICENSE.TERMS" for information on usage and redistribution
17 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
19 # $Id: echo.PL,v 1.1 1999/02/13 05:26:47 roberts Exp $
21 # Changed by skimo to demostrate autoflushing 1997/02/19
27 my($label, $envp) = @_;
28 print("$label:<br>\n<pre>\n");
29 my @keys = sort keys(%$envp);
30 foreach $key (@keys) {
31 print("$key=$$envp{$key}\n");
36 while (($key, $val) = each %ENV) {
37 $initialEnv{$key} = $val;
40 while(FCGI::accept() >= 0) {
41 print("Content-type: text/html\r\n\r\n",
42 "<title>FastCGI echo (Perl)</title>\n",
43 "<h1>FastCGI echo (Perl)</h1>\n",
44 "Request number ", ++$count, "<p>\n");
45 $len = 0 + $ENV{'CONTENT_LENGTH'};
47 print("No data from standard input.<p>\n");
49 print("Standard input:<br>\n<pre>\n");
50 for($i = 0; $i < $len; $i++) {
53 print("Error: Not enough bytes received ",
54 "on standard input<p>\n");
59 print("\n</pre><p>\n");
61 print_env("Request environment", \%ENV);
62 print "More on its way ... wait a few seconds\n<BR>\n<BR>";
65 print_env("Initial environment", \%initialEnv);