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.2 2000/12/14 13:46:23 skimo Exp $
21 # Changed by skimo to demostrate autoflushing 1997/02/19
28 my($label, $envp) = @_;
29 print("$label:<br>\n<pre>\n");
30 my @keys = sort keys(%$envp);
31 foreach my $key (@keys) {
32 print("$key=$$envp{$key}\n");
38 my $req = FCGI::Request(\*STDIN, \*STDOUT, \*STDERR, \%env);
40 while($req->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 my $len = 0 + $env{'CONTENT_LENGTH'};
47 print("No data from standard input.<p>\n");
49 print("Standard input:<br>\n<pre>\n");
50 for(my $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", \%ENV);