| Name | Size | Mode | Actions |
|---|---|---|---|
| echo.pl | 1609 | 0755 | editdlrm |
| remote.pl | 828 | 0755 | editdlrm |
| threaded.pl | 1149 | 0755 | editdlrm |
/usr/share/doc/libfcgi-perl/examples/echo.pl (1609B)
\n");
my @keys = sort keys(%$envp);
foreach my $key (@keys) {
print("$key=$$envp{$key}\n");
}
print("\n"); } my %env; my $req = FCGI::Request(\*STDIN, \*STDOUT, \*STDERR, \%env); my $count = 0; while($req->Accept() >= 0) { print("Content-type: text/html\r\n\r\n", "
\n"); my $len = 0 + $env{'CONTENT_LENGTH'}; if($len == 0) { print("No data from standard input.
\n");
} else {
print("Standard input:
\n
\n");
for(my $i = 0; $i < $len; $i++) {
my $ch = getc(STDIN);
if($ch eq "") {
print("Error: Not enough bytes received ",
"on standard input\n");
last;
}
print($ch);
}
print("\n
\n");
}
print_env("Request environment", \%env);
print "More on its way ... wait a few seconds\n
\n
";
$req->Flush();
sleep(3);
print_env("Initial environment", \%ENV);
$req->Finish();
}