[Persistentperl-users] Re: [Speedycgi-users] Help with STDOUT
Brought to you by:
samh
From: Sam H. <sa...@da...> - 2003-03-13 19:04:31
|
Your script is trying to read input from STDOUT, is that correct? That won't work - STDOUT works only for output, not input. This might work, if and when I add code to pass filehandles, but at the moment, PersistentPerl won't do that. > I have a problem grabbing STDOUT with PersistentPerl. It works fine when called via /usr/bin/perl or /usr/bin/suidperl. The script, and the debug output is below. > > perl and suidperl both have a line of STDOUT. perperl does not. WTF. > > Thanks for any advice! > > -------------- > > #!/usr/bin/suidperl -w > #!/usr/bin/perl -w > #!/usr/bin/perperl -w -- -M20 -r5 > # START TEST, RUN 3 TIMES USING DIFFERENT INTERPRETERS LISTED ABOVE > > select(STDIN); $|=1; > > while (<STDIN>) { > chomp($_); > &debug("STDIN LINE: $_"); > } > close(STDIN); > > select(STDOUT); $|=1; > open(SOUT,"<&STDOUT"); > while (<SOUT>) { > &debug("SOUT LINE: $_"); > } > > exit; > > ############################## > > sub debug { > > my $log = shift; > > open (T,">>/tmp/debug.log"); > flock(T,2); > print T $log . "\n"; > close (T); > } > > ############################## > # EOF > > > DEBUG OUTPUT UNDER PERPERL > ---------------------------- > STDIN: Received: from unknown (HELO nmgi.com) (64.217.128.161) > STDIN: by 0 with SMTP; 13 Mar 2003 15:40:22 -0000 > STDIN: Message-ID: <3E7...@nm...> > STDIN: Date: Thu, 13 Mar 2003 09:40:21 -0600 > STDIN: From: Dallas Engelken <da...@nm...> > STDIN: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021212 > STDIN: X-Accept-Language: en-us, en > STDIN: MIME-Version: 1.0 > STDIN: To: da...@nm... > STDIN: Subject: hi > STDIN: X-Enigmail-Version: 0.72.0.0 > STDIN: X-Enigmail-Supports: pgp-inline, pgp-mime > STDIN: Content-Type: text/plain; charset=us-ascii; format=flowed > STDIN: Content-Transfer-Encoding: 7bit > STDIN: > STDIN: hi > STDIN: > > > DEBUG OUTPUT UNDER PERL > ------------------------ > STDIN: Received: from unknown (HELO nmgi.com) (64.217.128.161) > STDIN: by 0 with SMTP; 13 Mar 2003 15:42:08 -0000 > STDIN: Message-ID: <3E7...@nm...> > STDIN: Date: Thu, 13 Mar 2003 09:42:07 -0600 > STDIN: From: Dallas Engelken <da...@nm...> > STDIN: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021212 > STDIN: X-Accept-Language: en-us, en > STDIN: MIME-Version: 1.0 > STDIN: To: da...@nm... > STDIN: Subject: hi > STDIN: X-Enigmail-Version: 0.72.0.0 > STDIN: X-Enigmail-Supports: pgp-inline, pgp-mime > STDIN: Content-Type: text/plain; charset=us-ascii; format=flowed > STDIN: Content-Transfer-Encoding: 7bit > STDIN: > STDIN: hi > STDIN: > SOUT LINE: Fda...@nm...Tda...@nm... > > > DEBUG OUTPUT UNDER SUIDPERL > -------------------------- > STDIN: Received: from unknown (HELO nmgi.com) (64.217.128.161) > STDIN: by 0 with SMTP; 13 Mar 2003 15:43:06 -0000 > STDIN: Message-ID: <3E7...@nm...> > STDIN: Date: Thu, 13 Mar 2003 09:43:06 -0600 > STDIN: From: Dallas Engelken <da...@nm...> > STDIN: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021212 > STDIN: X-Accept-Language: en-us, en > STDIN: MIME-Version: 1.0 > STDIN: To: da...@nm... > STDIN: Subject: hi > STDIN: X-Enigmail-Version: 0.72.0.0 > STDIN: X-Enigmail-Supports: pgp-inline, pgp-mime > STDIN: Content-Type: text/plain; charset=us-ascii; format=flowed > STDIN: Content-Transfer-Encoding: 7bit > STDIN: > STDIN: hi > STDIN: > SOUT LINE: Fda...@nm...Tda...@nm... > > > > ------------------------------------------------------- > This SF.net email is sponsored by:Crypto Challenge is now open! > Get cracking and register here for some mind boggling fun and > the chance of winning an Apple iPod: > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en > _______________________________________________ |