You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Mikael Stiernström <mi...@spacecoin.com> on 2002/02/08 14:22:39 UTC

optRedirectStdout problem

Hello!

I wonder if any of you gurus can help me with this problem.
When I looked in the archive I couldn't find any information about this
one.
When I use the optRedirectStdout option it seems that only stderr will
be redirected
not stdout. I've got the impression that it would be the other way
around.

    Mikael Stiernström

Platform:
Solaris 7
Apache/1.3.22
mod_perl/1.26

I have the following configuration in my httpd.conf
NameVirtualHost xxx.xxx.xxx.xxx
<VirtualHost xxx.xxx.xxx.xxx>
    ServerName foo.bar.com
    DocumentRoot /www/foo.bar.com/htdocs
    <Files *.html>
        SetHandler perl-scrip
        PerlHandler HTML::Embperl
        Options EcecCGI
        SetEnv EMBPERL_OPTIONS optRedirectStdout
        SetEnv EMBPERL_OPTIONS optRawInput
    </Files>
</VirtualHost>

I have tested with following embperl file
<html>
<head>
</head>
<body>
[-
    print OUT "Printing to OUT\n";
    print "Just printing (stdout)\n";
    print STDOUT "Printing to STDOUT\n";
    print STDERR "Printing to STDERR\n"
-]
</body>
</html>

Result in browser:
Just printing (stdout) Printing to STDOUT HTTP/1.1 200 OK Date: Fri, 08
Feb 2002 13:08:28 GMT Server: Apache/1.3.22 (Unix)
mod_perl/1.26 Content-Length: 279 Keep-Alive: timeout=15, max=100
Connection: Keep-Alive Content-Type: text/html; charset=iso-8859-1
Embperl
example html
Printing to OUT

from apache error_log:
...
Printing to STDERR
...



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: optRedirectStdout problem

Posted by Angus Lees <gu...@switchonline.com.au>.
On Fri, Feb 08, 2002 at 11:48:00AM -0800, Cliff Rayman wrote:
> On Fri, 8 Feb 2002, Gerald Richter wrote:
> 
> > >         SetEnv EMBPERL_OPTIONS optRedirectStdout
> > >         SetEnv EMBPERL_OPTIONS optRawInput
> > 
> > You have to use the numeric values (16 + 16384) and add them together:
> > 
> >       SetEnv EMBPERL_OPTIONS 16400
> it would be cool to be able to do
> 	SetEnv EMBPERL_OPTIONS "optRedirectStdout + optRawInput"
> in your spare time.  :-)

so use this in httpd.conf instead:

<Perl>
use HTML::Embperl ();

my $options = HTML::Embperl::optRedirectStdout +
	      HTML::Embperl::optRawInput;

@SetEnv = ([EMBPERL_OPTIONS => $options]);
</Perl>

-- 
 - Gus

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: optRedirectStdout problem

Posted by Gerald Richter <ri...@ecos.de>.
> On Fri, 8 Feb 2002, Gerald Richter wrote:
>
> > >         SetEnv EMBPERL_OPTIONS optRedirectStdout
> > >         SetEnv EMBPERL_OPTIONS optRawInput
> >
> > You have to use the numeric values (16 + 16384) and add them together:
> >
> >       SetEnv EMBPERL_OPTIONS 16400
> it would be cool to be able to do
> SetEnv EMBPERL_OPTIONS "optRedirectStdout + optRawInput"
> in your spare time.  :-)

Yes, of course. 2.0b6 will have the ability to use native Apache
configuration directives for configuration (i.e. without the SetEnv) and on
top of this I plan to support named options, instead of these ugly numbers.
So it should be either in 2.0b6 or b7

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: optRedirectStdout problem

Posted by Cliff Rayman <cl...@genwax.com>.

On Fri, 8 Feb 2002, Gerald Richter wrote:

> >         SetEnv EMBPERL_OPTIONS optRedirectStdout
> >         SetEnv EMBPERL_OPTIONS optRawInput
> 
> You have to use the numeric values (16 + 16384) and add them together:
> 
>       SetEnv EMBPERL_OPTIONS 16400
it would be cool to be able to do
	SetEnv EMBPERL_OPTIONS "optRedirectStdout + optRawInput"
in your spare time.  :-)
> 
> Gerald
> 
> 
> -------------------------------------------------------------
> Gerald Richter    ecos electronic communication services gmbh
> Internetconnect * Webserver/-design/-datenbanken * Consulting
> 
> Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
> E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
> WWW:        http://www.ecos.de      Fax:      +49 6133 925152
> -------------------------------------------------------------
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: optRedirectStdout problem

Posted by Gerald Richter <ri...@ecos.de>.
>         SetEnv EMBPERL_OPTIONS optRedirectStdout
>         SetEnv EMBPERL_OPTIONS optRawInput

You have to use the numeric values (16 + 16384) and add them together:

      SetEnv EMBPERL_OPTIONS 16400

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org