perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Rayner" <>
Subject Re: Execute() and App objects
Date Fri, 03 Apr 2009 17:15:45 GMT

Thanks for the suggestion.  I had tried using Execute with the subreq 
option, but I had problems, which might be related to our using FastCGI.

I also had tried using Execute with the object option, which seemed ideal, 
but could not get it to work.  Your pointer to the documentation gave me a 
clue as to why I could't get it to work.  There is an optional parameter to 
the object option called syntax.  The default syntax is HTML+Embperl.  I 
needed to specify Perl as the syntax.  This allows me to create an new App 
object from any within my application tree:

  my $app2 = Execute({object => '<path>/', syntax => 'Perl'});

Thanks and regards,

Doug Rayner
Senior System Architect
Savicom: Next Generation eMail Marketing
(415) 617-9006

----- Original Message ----- 
From: "Andrew O'Brien" <>
To: "Doug Rayner" <>; <>
Sent: Thursday, April 02, 2009 3:19 PM
Subject: RE: Execute() and App objects

Hi Doug,

> From within one request, I'm trying to Execute() an HTML
> template from
> another part of the application.  That template is dependent
> on App object
> methods defined in the that is in the same directory
> as the HTML
> template.  However, the Execute() seems to use the Req and
> App objects from
> the calling context.  That App object does not have the
> appropriate methods
> defined, and I'd prefer not to have to copy them there, of
> find some other
> way to share them between the two App objects.
> Does anyone have any ideas on how to make this Execute()
> behave as what I
> would call a 'first class request'?  In other words, get it
> to load and use
> the that is associated with the target HTML template?

Haven't used it recently but the subrequest process is probably what
you're after:

"When running Embperl with Apache 2.0 there are some extented
possibilities. While Apache 1.x has send all it's ouput directly to the
browser, Apache 2.0 introduces a concept of filters, which allows to
process the output of any Apache handler through a chain of filters.
Embperl can use this to embed any output that Apache can generate as a
Embperl::Object component, just like it is any native Embperl page. This
can be done by using the subreq parameter:

    [- Execute ({subreq=>'/cgi-bin/script.cgi'}) -]

The above code includes the output of a cgi script into a page."



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message