You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Andre Landwehr <an...@gmx.net> on 2002/08/26 10:17:35 UTC

Embperl::Object problem

Hi again,

Embperl files run quite ok on my 2.0b8 installation now, but
Embperl::Object does strange things which I hunted the whole day,
but I don't come closer...
I have an object base file _base.epo which looks like this:
[- $req = shift; -]
[- Execute ({inputfile => '_htmlheader.epo', package => __PACKAGE__}); -]
[- Execute ({inputfile => '*', package => __PACKAGE__}); -]
[- Execute ({inputfile => '_htmlfooter.epo', package => __PACKAGE__}); -]

If the _htmlheader.epo file contains only html just header and
footer are displayed, '*' is ignored completely (I can repair
that by just saying Execute ('*'), but I want to have it in
__PACKAGE__). 
If _htmlheader.epo contains [- print OUT "something"; -] it gets even
worse. The output looks like first the print statement is
executed, then the http headers are sent and then then
_htmlheader.epo and _htmlfooter.epo.

My configuration looks like this:
AddType text/html;charset=ISO-8859-1 .epo
PerlWarn On
PerlModule MD5
PerlModule Embperl
PerlModule Apache::DBI
EMBPERL_ESCMODE 0
EMBPERL_SESSION_CLASSES "File Semaphore"
EMBPERL_SESSION_ARGS "Directory=/tmp"
EMBPERL_COOKIE_PATH "/"
<Files *.epo>
    EMBPERL_APPNAME myapp
    EMBPERL_OPTIONS 16388
    EMBPERL_OBJECT_BASE _base.epo
    EMBPERL_OBJECT_STOPDIR /var/www
    EMBPERL_OBJECT_ADDPATH :/var/www/components:
    SetHandler  perl-script
    PerlHandler Embperl::Object
    Options     ExecCGI
</Files>

I think it has to do with my configuration because the same pages worked
without problems under 1.3.x, but I run out of ideas...

Andre

--
"The inside of a computer is as dumb as hell, but it goes like mad!"
(Physicist Richard Feynman)


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


Re: Embperl::Object problem

Posted by Gerald Richter <ri...@ecos.de>.
>
> Now I print to OUT explicitly it works, thanks a lot! Alas, I
> have enabled optRedirectStdout (the option value I set is 16388),
> so this should never have happened, should it?
>

optRedirectStdout is not yet implemented in 2.0. I just saw that this fact
is missing in README.v2...

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: Embperl::Object problem

Posted by Andre Landwehr <an...@gmx.net>.
On Mon, Aug 26, 2002 at 01:43:59PM +0200, Gerald Richter wrote:
> This normaly only happens if you print to STDOUT instead of OUT. If you are
> sure you print to OUT, try to use
> 
> [- Embperl::output ('yout text') ; -]
> 
> Does this change anything? If yes, it would mean that OUT is somehow not
> correctly set, if no we have to search in another direction.

Now I print to OUT explicitly it works, thanks a lot! Alas, I
have enabled optRedirectStdout (the option value I set is 16388), 
so this should never have happened, should it?

Andre

--
"The inside of a computer is as dumb as hell, but it goes like mad!"
(Physicist Richard Feynman)


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


Re: Embperl::Object problem

Posted by Gerald Richter <ri...@ecos.de>.

> On Mon, Aug 26, 2002 at 11:21:37AM +0200, Gerald Richter wrote:
> > This will not work, because Embperl sets up the @ISA to be
> >
> > * -> base.epl -> Embperl::Req
> >
> > if * and base.epl are the same package, this will cause trouble...
>
> ok, I have taken out the package assignments. But still every
> output done by print statements in scripts called before '*'
> appears before the http headers. How can that be?
>

This normaly only happens if you print to STDOUT instead of OUT. If you are
sure you print to OUT, try to use

[- Embperl::output ('yout text') ; -]

Does this change anything? If yes, it would mean that OUT is somehow not
correctly set, if no we have to search in another direction.

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: Embperl::Object problem

Posted by Andre Landwehr <an...@gmx.net>.
On Mon, Aug 26, 2002 at 11:21:37AM +0200, Gerald Richter wrote:
> This will not work, because Embperl sets up the @ISA to be
> 
> * -> base.epl -> Embperl::Req
> 
> if * and base.epl are the same package, this will cause trouble...

ok, I have taken out the package assignments. But still every
output done by print statements in scripts called before '*' 
appears before the http headers. How can that be?

Andre

--
"The inside of a computer is as dumb as hell, but it goes like mad!"
(Physicist Richard Feynman)


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


Re: Embperl::Object problem

Posted by Gerald Richter <ri...@ecos.de>.
Hi,

> I have an object base file _base.epo which looks like this:
> [- $req = shift; -]
> [- Execute ({inputfile => '_htmlheader.epo', package => __PACKAGE__}); -]
> [- Execute ({inputfile => '*', package => __PACKAGE__}); -]

This will not work, because Embperl sets up the @ISA to be

* -> base.epl -> Embperl::Req

if * and base.epl are the same package, this will cause trouble...

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