Hi,
> if I set optEarlyHttpHeader (64) within my EMBPERL_OPTIONS my
> page ist correctly shown in the browser. But if
> optEarlyHttpHeader is not set, the contents of my page are mixed
> up. I use several blocks of [- -] and [* *] and I execute two
> Shellscripts using perls backtick-syntax (unfortunately I cannot
> avoid this due to backward compatibility with other pages, those
> scripts do some layout stuff). The different blocks of my page
> get reordered and in between I see the HTTP-Headers.
>
> Can I avoid this reordering and ensure a correct display of my
> page without having to do a major rewrite?
>

Without optEarlyHttpHeader Embperl is buffering your output and if anything
is ok sends the headers and afterwards the content of the page. If you print
directly to STDOUT, this will send directly to the browser and not buffered
by Embperl, so it will be shown up before the http headers. You can use the
optRedirectStdout to also buffer normal output to Perl's STDOUT, but this
will not affect shell scripts.

If you want to buffer the shell script output, you need to read the output
and output it afterwards:

[+

local $/= undef ;
open FH, "foo.sh|" ;
$out = <FH> ;
close FH ;

$out ;
+]

Gerald

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

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     [EMAIL PROTECTED]         Voice:    +49 6133 925151
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------

Reply via email to