FCGI(3pm) | User Contributed Perl Documentation | FCGI(3pm) |
FCGI - Fast CGI module
use FCGI; my $count = 0; my $request = FCGI::Request(); while($request->Accept() >= 0) { print("Content-type: text/html\r\n\r\n", ++$count); }
Functions:
You should only use your own socket if your program is not started by a process manager such as mod_fastcgi (except for the FastCgiExternalServer case) or cgi-fcgi. If you use the option, you have to let your FastCGI server know which port (and possibly server) your program is listening on. See remote.pl for an example.
Example usage:
my $req = FCGI::Request;
or:
my %env;
my $in = new IO::Handle;
my $out = new IO::Handle;
my $err = new IO::Handle;
my $req = FCGI::Request($in,
$out, $err, \%env);
Note that unlike with the old interface, no die and warn handlers are installed by default. This means that if you are not running an sfio enabled perl, any warn or die message will not end up in the server's log by default. It is advised you set up die and warn handlers yourself. FCGI.pm contains an example of die and warn handlers.
Note that this method is still experimental and everything about it, including its name, is subject to change.
FCGI.pm isn't Unicode aware, only characters within the range 0x00-0xFF are supported. Attempts to output strings containing characters above 0xFF results in a exception: (F) "Wide character in %s".
Users who wants the previous (FCGI.pm <= 0.68) incorrect behavior can disable the exception by using the "bytes" pragma.
{ use bytes; print "\x{263A}"; }
Sven Verdoolaege <skimo@kotnet.org>
This software is copyrighted (c) 1996 by by Open Market, Inc.
See the LICENSE file in this distribution for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
2022-11-20 | perl v5.36.0 |