1 # $Id: FCGI.pm,v 1.4 1999/08/03 15:52:54 skimo Exp $
8 @ISA = qw(Exporter DynaLoader);
9 # Items to export into callers namespace by default. Note: do not export
10 # names by default without a very good reason. Use EXPORT_OK instead.
11 # Do not simply export all your public functions/methods/constants.
20 # Preloaded methods go here.
22 # Autoload methods go after __END__, and are processed by the autosplit program.
29 return Accept(@_) if @_ == 5;
31 if (defined %FCGI::ENV) {
36 my $rc = Accept($global_request, \*STDIN, \*STDOUT, \*STDERR, \%ENV);
39 $SIG{__WARN__} = $SIG{__DIE__} = $warn_die_handler if (tied (*STDIN));
45 return Finish(@_) if @_ == 1;
47 %ENV = %FCGI::ENV if (defined %FCGI::ENV);
51 for (qw(__WARN__ __DIE__)) {
52 delete $SIG{$_} if ($SIG{$_} == $warn_die_handler);
56 Finish ($global_request);
60 return Flush(@_) if @_ == 1;
62 Flush($global_request);
69 sub start_filter_data(;$) {
70 return StartFilterData(@_) if @_ == 1;
72 StartFilterData($global_request);
75 $global_request = Request();
76 $warn_die_handler = sub { print STDERR @_ };
81 shift->PRINT(sprintf(shift, @_));
88 FCGI - Fast CGI module
95 while(FCGI::accept() >= 0) {
96 print("Content-type: text/html\r\n\r\n", ++$count);
107 Accepts a connection. Returns 0 on success.
108 If a connection has been accepted before, the old
109 one will be finished first.
113 Finishes accepted connection.
117 Flushes accepted connection.
119 =item FCGI::set_exit_status(status)
121 Sets the exit status that finish returns to the server.
123 =item FCGI::start_filter_data()
125 Does anyone use this function ?
131 Sven Verdoolaege <skimo@kotnet.org>