You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by "Justin M. Harrison" <sh...@doublebagel.com> on 2002/07/22 23:54:16 UTC
Execute
Is there any consolidated documentation on what exactly Execute can do,
and how files can be brought in or executed? Everything I have found
about it seems to be scattered about Embperl, Embperl::Object, etc, in
both documentation and introduction...
Reading through the documentation I have found several different uses of
it, but I am wondering if there are more
(http://perl.apache.org/embperl/pod/doc/Embperl.-page-3-.htm#sect_7
shows " [- Execute ({ inputfile => 'mylib.htm', import => 1 }) -]", then
on http://perl.apache.org/embperl/pod/doc/EmbperlObject.-page-6-.htm "[-
Execute ('foot.htm') -]", and
http://perl.apache.org/embperl/pod/intro/Intro.-page-7-.htm shows [-
Execute ('navbar.html', 'Infos') -] as a possible use. Whats the syntax
for it?")
Sorry if this has been answered. Thanks for the great framework!
Justin
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Execute
Posted by Gerald Richter <ri...@ecos.de>.
>
> In the 1.3 docs it's laid out pretty well here:
>
>
http://perl.apache.org/embperl/pod/doc/doc13/HTML/Embperl.-page-3-.htm#sect_
4
>
> I'm not sure if there's an equivalent section in the 2.0 docs yet.
>
I am just in process of rewriting this part of the docs for 2.0 and have
removed the old docs. Some of the new possible parameters can be found under
http://perl.apache.org/embperl/pod/doc/Config.-page-2-.htm (you can use
what's listed under method name, as parameter to Execute), but some of the
parameters still missing.
So looking to the 1.3 docs for now is ok.
Gerald
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Execute
Posted by Gavin Carr <ga...@openfusion.com.au>.
On Tue, Jul 23, 2002 at 11:02:07PM -0400, Justin Harrison wrote:
> It seems to work in some fashion with Embperl Meta Subs..
>
> Is it by design that it seems not to function with perl subs? Am I doing
> something wrong? :-( Is there anyway to make it function with perl subs?
The easy perl sub way is to make your content.pm a proper object
(i.e. bless it yourself) and then change your instantiation to
[- $r->{content} = zoweb::content::content->new() -]. That will
definitely work.
Cheers,
Gavin
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Execute
Posted by Gerald Richter <ri...@ecos.de>.
> > > To get the Embperl request object, you need to get the first
> > > parameter passed to the page (not to the sub):
> > >
> > > [-
> > > $r = shift ;
> > > -]
> > >
>
> I am using Perl syntax, so this does not work, and trying $r = shift
> results in nothing..
>
ok, I was a little unclear. The $r = shift works in a normal page that is
executed, not in the file that is included via the object => parameter. To
get $r in this case you must retrive it in the calling page and pass it as a
parameter, e.g.:
calling page
[-
$r = shift ;
$obj = Execute ({object => 'file.pl', syntax => 'Perl'}) ;
$obj -> mysub ($r) ;
-]
in the file.pl
sub mysub
{
my ($self, $r) = @_ ;
....
}
So I hope that's better now, sorry for my misleading description
Gerald
> > -----Original Message-----
> > From: Justin Harrison [mailto:shadowj4@doublebagel.com]
> > Sent: Tuesday, July 30, 2002 12:37 PM
> > To: embperl@perl.apache.org
> > Subject: RE: Execute
> >
> >
> > Hi Gerald,
> >
> > Thanks for your response. It definitely does.
> >
> > > -----Original Message-----
> > > From: Gerald Richter [mailto:richter@ecos.de]
> > > Sent: Tuesday, July 30, 2002 2:53 AM
> > > To: Justin Harrison; embperl@perl.apache.org
> > > Subject: Re: Execute
> > >
> > >
> > >
> > >
> > > > I'm having problems trying to get an embperl::req object in my
> > > > imported perl code (As objects)..
> > > >
> > > > [- Execute ({'object'
> > > > =>'/home/user/dir/lib/web/whatever/whatever.pm',syntax =>
> > > 'Perl'}) -]
> > > >
> > > >
> > >
> > http://perl.apache.org/embperl/pod/intro/IntroEmbperlObject.-page-5-.h
> > > > tm
> > > > says:
> > > >
> > > > "This object is passed in on the stack, so you can retrieve
> > > it using
> > > > the Perl "shift" statement."
> > > >
> > > > The first argument to my sub routines in whatever.pm, when
> > > imported as
> > > > objects, however, does not seem to be the same request
> > object (Or a
> > > > request object at all? Looking at it...) I used in the
> > > caller for the
> > > > execution of the perl file.
> > > >
> > > > It receives Embperl::__7=HASH(0xa8b0304) as the first argument (An
> > > > object reference?)..
> > > >
> > >
> > > Yes, this is correct. That's the object you have created not
> > > the Embperl request object.
> > >
> > > > I tried to use Data Dump on it, but it segfaulted Apache
> > everytime.
> > > >
> > >
> > > This may happen if Data::DUmper tries to display the "magic"
> > > Embperl uses to tied it's data to this request record. I
> > > never tried this...
> > >
> > > To get the Embperl request object, you need to get the first
> > > parameter passed to the page (not to the sub):
> > >
> > > [-
> > > $r = shift ;
> > > -]
> > >
> > > > I tried importing it to access sub routines "normally", but
> > > it didn't
> > > > find them in the current name space.
> > > >
> > >
> > > This should work when you use the import => 1 parameter. When
> > > using the object parameter you should do something like the
> > > following to call them:
> > >
> > > [-
> > > $obj = Execute ({'object'
> > > =>'/home/user/dir/lib/web/whatever/whatever.pm',syntax => 'Perl'})
> > >
> > > $obj -> mysub ;
> > >
> > > -]
> > >
> > > in mysub you get $obj passed as first parameter
> > >
> > > Hope this makes things a little bit more clear
> > >
> > > Gerald
> > >
> > >
> > > > > -----Original Message-----
> > > > > From: Justin Harrison [mailto:shadowj4@doublebagel.com]
> > > > > Sent: Thursday, July 25, 2002 9:12 PM
> > > > > To: embperl@perl.apache.org
> > > > > Subject: RE: Execute
> > > > >
> > > > >
> > > > > Thank you Gerald. I love you.
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Gerald Richter [mailto:richter@ecos.de]
> > > > > > Sent: Thursday, July 25, 2002 7:45 PM
> > > > > > To: Justin Harrison; embperl@perl.apache.org
> > > > > > Subject: Re: Execute
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > > It seems to work in some fashion with Embperl Meta Subs..
> > > > > > >
> > > > > > > Is it by design that it seems not to function with
> > > perl subs? Am
> > > > > > > I doing something wrong? :-( Is there anyway to make it
> > > > > function with
> > > > > > > perl subs?
> > > > > > >
> > > > > >
> > > > > > It also works with perl subs, but you either need to
> > > tell Execute
> > > > > > that you are loading pure Perl code or wrap your sub's
> > > inside of a
> > > > > > [- -] block:
> > > > > >
> > > > > > Either:
> > > > > >
> > > > > > [- $r->{content} = Execute ({'object' =>
> > > > > > '/home/zo/zo/lib/zoweb/content/content.pm',
> > > > > > syntax => 'Perl'
> > > > > > }) -]
> > > > > >
> > > > > > or
> > > > > >
> > > > > > > > In content.pm:
> > > > > > > >
> > > > > > > > #package zoweb::content::content;
> > > > > > > > #use strict;
> > > > > >
> > > > > > # Never put a package statement here, Embperl will setup the
> > > > > > package for you
> > > > > >
> > > > > > [-
> > > > > > sub title {
> > > > > > }
> > > > > >
> > > > > > -]
> > > > > >
> > > > > > Gerald
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > --------------------------------------------------------------------
> > > > > -
> > > > > > 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
> > > > >
> > > >
> > > >
> > > >
> > >
> > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> > > > For additional commands, e-mail: embperl-help@perl.apache.org
> > > >
> > > >
> > >
> > >
> > > -------------------------------------------------------------
> > > 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
>
>
-------------------------------------------------------------
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: Execute
Posted by Justin Harrison <sh...@doublebagel.com>.
> > To get the Embperl request object, you need to get the first
> > parameter passed to the page (not to the sub):
> >
> > [-
> > $r = shift ;
> > -]
> >
I am using Perl syntax, so this does not work, and trying $r = shift
results in nothing..
> -----Original Message-----
> From: Justin Harrison [mailto:shadowj4@doublebagel.com]
> Sent: Tuesday, July 30, 2002 12:37 PM
> To: embperl@perl.apache.org
> Subject: RE: Execute
>
>
> Hi Gerald,
>
> Thanks for your response. It definitely does.
>
> > -----Original Message-----
> > From: Gerald Richter [mailto:richter@ecos.de]
> > Sent: Tuesday, July 30, 2002 2:53 AM
> > To: Justin Harrison; embperl@perl.apache.org
> > Subject: Re: Execute
> >
> >
> >
> >
> > > I'm having problems trying to get an embperl::req object in my
> > > imported perl code (As objects)..
> > >
> > > [- Execute ({'object'
> > > =>'/home/user/dir/lib/web/whatever/whatever.pm',syntax =>
> > 'Perl'}) -]
> > >
> > >
> >
> http://perl.apache.org/embperl/pod/intro/IntroEmbperlObject.-page-5-.h
> > > tm
> > > says:
> > >
> > > "This object is passed in on the stack, so you can retrieve
> > it using
> > > the Perl "shift" statement."
> > >
> > > The first argument to my sub routines in whatever.pm, when
> > imported as
> > > objects, however, does not seem to be the same request
> object (Or a
> > > request object at all? Looking at it...) I used in the
> > caller for the
> > > execution of the perl file.
> > >
> > > It receives Embperl::__7=HASH(0xa8b0304) as the first argument (An
> > > object reference?)..
> > >
> >
> > Yes, this is correct. That's the object you have created not
> > the Embperl request object.
> >
> > > I tried to use Data Dump on it, but it segfaulted Apache
> everytime.
> > >
> >
> > This may happen if Data::DUmper tries to display the "magic"
> > Embperl uses to tied it's data to this request record. I
> > never tried this...
> >
> > To get the Embperl request object, you need to get the first
> > parameter passed to the page (not to the sub):
> >
> > [-
> > $r = shift ;
> > -]
> >
> > > I tried importing it to access sub routines "normally", but
> > it didn't
> > > find them in the current name space.
> > >
> >
> > This should work when you use the import => 1 parameter. When
> > using the object parameter you should do something like the
> > following to call them:
> >
> > [-
> > $obj = Execute ({'object'
> > =>'/home/user/dir/lib/web/whatever/whatever.pm',syntax => 'Perl'})
> >
> > $obj -> mysub ;
> >
> > -]
> >
> > in mysub you get $obj passed as first parameter
> >
> > Hope this makes things a little bit more clear
> >
> > Gerald
> >
> >
> > > > -----Original Message-----
> > > > From: Justin Harrison [mailto:shadowj4@doublebagel.com]
> > > > Sent: Thursday, July 25, 2002 9:12 PM
> > > > To: embperl@perl.apache.org
> > > > Subject: RE: Execute
> > > >
> > > >
> > > > Thank you Gerald. I love you.
> > > >
> > > > > -----Original Message-----
> > > > > From: Gerald Richter [mailto:richter@ecos.de]
> > > > > Sent: Thursday, July 25, 2002 7:45 PM
> > > > > To: Justin Harrison; embperl@perl.apache.org
> > > > > Subject: Re: Execute
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > > It seems to work in some fashion with Embperl Meta Subs..
> > > > > >
> > > > > > Is it by design that it seems not to function with
> > perl subs? Am
> > > > > > I doing something wrong? :-( Is there anyway to make it
> > > > function with
> > > > > > perl subs?
> > > > > >
> > > > >
> > > > > It also works with perl subs, but you either need to
> > tell Execute
> > > > > that you are loading pure Perl code or wrap your sub's
> > inside of a
> > > > > [- -] block:
> > > > >
> > > > > Either:
> > > > >
> > > > > [- $r->{content} = Execute ({'object' =>
> > > > > '/home/zo/zo/lib/zoweb/content/content.pm',
> > > > > syntax => 'Perl'
> > > > > }) -]
> > > > >
> > > > > or
> > > > >
> > > > > > > In content.pm:
> > > > > > >
> > > > > > > #package zoweb::content::content;
> > > > > > > #use strict;
> > > > >
> > > > > # Never put a package statement here, Embperl will setup the
> > > > > package for you
> > > > >
> > > > > [-
> > > > > sub title {
> > > > > }
> > > > >
> > > > > -]
> > > > >
> > > > > Gerald
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > --------------------------------------------------------------------
> > > > -
> > > > > 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
> > > >
> > >
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> > > For additional commands, e-mail: embperl-help@perl.apache.org
> > >
> > >
> >
> >
> > -------------------------------------------------------------
> > 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: Execute
Posted by Justin Harrison <sh...@doublebagel.com>.
Hi Gerald,
Thanks for your response. It definitely does.
> -----Original Message-----
> From: Gerald Richter [mailto:richter@ecos.de]
> Sent: Tuesday, July 30, 2002 2:53 AM
> To: Justin Harrison; embperl@perl.apache.org
> Subject: Re: Execute
>
>
>
>
> > I'm having problems trying to get an embperl::req object in my
> > imported perl code (As objects)..
> >
> > [- Execute ({'object'
> > =>'/home/user/dir/lib/web/whatever/whatever.pm',syntax =>
> 'Perl'}) -]
> >
> >
> http://perl.apache.org/embperl/pod/intro/IntroEmbperlObject.-page-5-.h
> > tm
> > says:
> >
> > "This object is passed in on the stack, so you can retrieve
> it using
> > the Perl "shift" statement."
> >
> > The first argument to my sub routines in whatever.pm, when
> imported as
> > objects, however, does not seem to be the same request object (Or a
> > request object at all? Looking at it...) I used in the
> caller for the
> > execution of the perl file.
> >
> > It receives Embperl::__7=HASH(0xa8b0304) as the first argument (An
> > object reference?)..
> >
>
> Yes, this is correct. That's the object you have created not
> the Embperl request object.
>
> > I tried to use Data Dump on it, but it segfaulted Apache everytime.
> >
>
> This may happen if Data::DUmper tries to display the "magic"
> Embperl uses to tied it's data to this request record. I
> never tried this...
>
> To get the Embperl request object, you need to get the first
> parameter passed to the page (not to the sub):
>
> [-
> $r = shift ;
> -]
>
> > I tried importing it to access sub routines "normally", but
> it didn't
> > find them in the current name space.
> >
>
> This should work when you use the import => 1 parameter. When
> using the object parameter you should do something like the
> following to call them:
>
> [-
> $obj = Execute ({'object'
> =>'/home/user/dir/lib/web/whatever/whatever.pm',syntax => 'Perl'})
>
> $obj -> mysub ;
>
> -]
>
> in mysub you get $obj passed as first parameter
>
> Hope this makes things a little bit more clear
>
> Gerald
>
>
> > > -----Original Message-----
> > > From: Justin Harrison [mailto:shadowj4@doublebagel.com]
> > > Sent: Thursday, July 25, 2002 9:12 PM
> > > To: embperl@perl.apache.org
> > > Subject: RE: Execute
> > >
> > >
> > > Thank you Gerald. I love you.
> > >
> > > > -----Original Message-----
> > > > From: Gerald Richter [mailto:richter@ecos.de]
> > > > Sent: Thursday, July 25, 2002 7:45 PM
> > > > To: Justin Harrison; embperl@perl.apache.org
> > > > Subject: Re: Execute
> > > >
> > > >
> > > >
> > > >
> > > > > It seems to work in some fashion with Embperl Meta Subs..
> > > > >
> > > > > Is it by design that it seems not to function with
> perl subs? Am
> > > > > I doing something wrong? :-( Is there anyway to make it
> > > function with
> > > > > perl subs?
> > > > >
> > > >
> > > > It also works with perl subs, but you either need to
> tell Execute
> > > > that you are loading pure Perl code or wrap your sub's
> inside of a
> > > > [- -] block:
> > > >
> > > > Either:
> > > >
> > > > [- $r->{content} = Execute ({'object' =>
> > > > '/home/zo/zo/lib/zoweb/content/content.pm',
> > > > syntax => 'Perl'
> > > > }) -]
> > > >
> > > > or
> > > >
> > > > > > In content.pm:
> > > > > >
> > > > > > #package zoweb::content::content;
> > > > > > #use strict;
> > > >
> > > > # Never put a package statement here, Embperl will setup the
> > > > package for you
> > > >
> > > > [-
> > > > sub title {
> > > > }
> > > >
> > > > -]
> > > >
> > > > Gerald
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> --------------------------------------------------------------------
> > > -
> > > > 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
> > >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> > For additional commands, e-mail: embperl-help@perl.apache.org
> >
> >
>
>
> -------------------------------------------------------------
> 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: Execute
Posted by Gerald Richter <ri...@ecos.de>.
> I'm having problems trying to get an embperl::req object in my imported
> perl code (As objects)..
>
> [- Execute ({'object'
> =>'/home/user/dir/lib/web/whatever/whatever.pm',syntax => 'Perl'}) -]
>
> http://perl.apache.org/embperl/pod/intro/IntroEmbperlObject.-page-5-.htm
> says:
>
> "This object is passed in on the stack, so you can retrieve it using the
> Perl "shift" statement."
>
> The first argument to my sub routines in whatever.pm, when imported as
> objects, however, does not seem to be the same request object (Or a
> request object at all? Looking at it...) I used in the caller for the
> execution of the perl file.
>
> It receives Embperl::__7=HASH(0xa8b0304) as the first argument (An
> object reference?)..
>
Yes, this is correct. That's the object you have created not the Embperl
request object.
> I tried to use Data Dump on it, but it segfaulted Apache everytime.
>
This may happen if Data::DUmper tries to display the "magic" Embperl uses to
tied it's data to this request record. I never tried this...
To get the Embperl request object, you need to get the first parameter
passed to the page (not to the sub):
[-
$r = shift ;
-]
> I tried importing it to access sub routines "normally", but it didn't
> find them in the current name space.
>
This should work when you use the import => 1 parameter. When using the
object parameter you should do something like the following to call them:
[-
$obj = Execute ({'object'
=>'/home/user/dir/lib/web/whatever/whatever.pm',syntax => 'Perl'})
$obj -> mysub ;
-]
in mysub you get $obj passed as first parameter
Hope this makes things a little bit more clear
Gerald
> > -----Original Message-----
> > From: Justin Harrison [mailto:shadowj4@doublebagel.com]
> > Sent: Thursday, July 25, 2002 9:12 PM
> > To: embperl@perl.apache.org
> > Subject: RE: Execute
> >
> >
> > Thank you Gerald. I love you.
> >
> > > -----Original Message-----
> > > From: Gerald Richter [mailto:richter@ecos.de]
> > > Sent: Thursday, July 25, 2002 7:45 PM
> > > To: Justin Harrison; embperl@perl.apache.org
> > > Subject: Re: Execute
> > >
> > >
> > >
> > >
> > > > It seems to work in some fashion with Embperl Meta Subs..
> > > >
> > > > Is it by design that it seems not to function with perl subs? Am I
> > > > doing something wrong? :-( Is there anyway to make it
> > function with
> > > > perl subs?
> > > >
> > >
> > > It also works with perl subs, but you either need to tell
> > > Execute that you are loading pure Perl code or wrap your
> > > sub's inside of a [- -] block:
> > >
> > > Either:
> > >
> > > [- $r->{content} = Execute ({'object' =>
> > > '/home/zo/zo/lib/zoweb/content/content.pm',
> > > syntax => 'Perl'
> > > }) -]
> > >
> > > or
> > >
> > > > > In content.pm:
> > > > >
> > > > > #package zoweb::content::content;
> > > > > #use strict;
> > >
> > > # Never put a package statement here, Embperl will setup the
> > > package for you
> > >
> > > [-
> > > sub title {
> > > }
> > >
> > > -]
> > >
> > > Gerald
> > >
> > >
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > 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
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
>
>
-------------------------------------------------------------
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: Execute
Posted by Justin Harrison <sh...@doublebagel.com>.
I'm having problems trying to get an embperl::req object in my imported
perl code (As objects)..
[- Execute ({'object'
=>'/home/user/dir/lib/web/whatever/whatever.pm',syntax => 'Perl'}) -]
http://perl.apache.org/embperl/pod/intro/IntroEmbperlObject.-page-5-.htm
says:
"This object is passed in on the stack, so you can retrieve it using the
Perl "shift" statement."
The first argument to my sub routines in whatever.pm, when imported as
objects, however, does not seem to be the same request object (Or a
request object at all? Looking at it...) I used in the caller for the
execution of the perl file.
It receives Embperl::__7=HASH(0xa8b0304) as the first argument (An
object reference?)..
I tried to use Data Dump on it, but it segfaulted Apache everytime.
I tried importing it to access sub routines "normally", but it didn't
find them in the current name space.
> -----Original Message-----
> From: Justin Harrison [mailto:shadowj4@doublebagel.com]
> Sent: Thursday, July 25, 2002 9:12 PM
> To: embperl@perl.apache.org
> Subject: RE: Execute
>
>
> Thank you Gerald. I love you.
>
> > -----Original Message-----
> > From: Gerald Richter [mailto:richter@ecos.de]
> > Sent: Thursday, July 25, 2002 7:45 PM
> > To: Justin Harrison; embperl@perl.apache.org
> > Subject: Re: Execute
> >
> >
> >
> >
> > > It seems to work in some fashion with Embperl Meta Subs..
> > >
> > > Is it by design that it seems not to function with perl subs? Am I
> > > doing something wrong? :-( Is there anyway to make it
> function with
> > > perl subs?
> > >
> >
> > It also works with perl subs, but you either need to tell
> > Execute that you are loading pure Perl code or wrap your
> > sub's inside of a [- -] block:
> >
> > Either:
> >
> > [- $r->{content} = Execute ({'object' =>
> > '/home/zo/zo/lib/zoweb/content/content.pm',
> > syntax => 'Perl'
> > }) -]
> >
> > or
> >
> > > > In content.pm:
> > > >
> > > > #package zoweb::content::content;
> > > > #use strict;
> >
> > # Never put a package statement here, Embperl will setup the
> > package for you
> >
> > [-
> > sub title {
> > }
> >
> > -]
> >
> > Gerald
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > 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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
RE: Execute
Posted by Justin Harrison <sh...@doublebagel.com>.
Thank you Gerald. I love you.
> -----Original Message-----
> From: Gerald Richter [mailto:richter@ecos.de]
> Sent: Thursday, July 25, 2002 7:45 PM
> To: Justin Harrison; embperl@perl.apache.org
> Subject: Re: Execute
>
>
>
>
> > It seems to work in some fashion with Embperl Meta Subs..
> >
> > Is it by design that it seems not to function with perl subs? Am I
> > doing something wrong? :-( Is there anyway to make it function with
> > perl subs?
> >
>
> It also works with perl subs, but you either need to tell
> Execute that you are loading pure Perl code or wrap your
> sub's inside of a [- -] block:
>
> Either:
>
> [- $r->{content} = Execute ({'object' =>
> '/home/zo/zo/lib/zoweb/content/content.pm',
> syntax => 'Perl'
> }) -]
>
> or
>
> > > In content.pm:
> > >
> > > #package zoweb::content::content;
> > > #use strict;
>
> # Never put a package statement here, Embperl will setup the
> package for you
>
> [-
> sub title {
> }
>
> -]
>
> Gerald
>
>
>
>
> ---------------------------------------------------------------------
> 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: Execute
Posted by Gerald Richter <ri...@ecos.de>.
> It seems to work in some fashion with Embperl Meta Subs..
>
> Is it by design that it seems not to function with perl subs? Am I doing
> something wrong? :-( Is there anyway to make it function with perl subs?
>
It also works with perl subs, but you either need to tell Execute that you
are loading pure Perl code or wrap your sub's inside of a [- -] block:
Either:
[- $r->{content} = Execute ({'object' =>
'/home/zo/zo/lib/zoweb/content/content.pm',
syntax => 'Perl'
}) -]
or
> > In content.pm:
> >
> > #package zoweb::content::content;
> > #use strict;
# Never put a package statement here, Embperl will setup the package for you
[-
sub title {
}
-]
Gerald
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
RE: Execute
Posted by Justin Harrison <sh...@doublebagel.com>.
It seems to work in some fashion with Embperl Meta Subs..
Is it by design that it seems not to function with perl subs? Am I doing
something wrong? :-( Is there anyway to make it function with perl subs?
> -----Original Message-----
> From: Justin Harrison [mailto:shadowj4@doublebagel.com]
> Sent: Tuesday, July 23, 2002 10:26 PM
> To: embperl@perl.apache.org
> Subject: RE: Execute
>
>
> Thanks for your response.
>
> I am trying this in embperl 2 b8.
>
> In the main embperl file:
>
> [- $r = shift -]
>
> [- $r->{content} = Execute ({'object' =>
> '/home/zo/zo/lib/zoweb/content/content.pm'}) -]
>
> [- Execute ('/home/zo/zo/web/template.epl') -]
>
> In template.epl:
>
> [- $r = shift -]
> <html>
> <head>
> <title>[+ $r->{content}->title +]</title>
>
> In content.pm:
>
> #package zoweb::content::content;
> #use strict;
>
> sub output {
> }
>
> sub title {
> }
>
> #1;
>
>
> Embperl is dying at "<title>[+ $r->{content}->title +]</title>", with:
>
> "Error in Perl code: Can't locate object method "title" via
> package "Embperl::__2" (perhaps you forgot to load "Embperl::__2"?)"
>
> I threw Data::Dump on $r->{content} and it revealed:
>
> bless({}, "Embperl::__2")
>
> Any ideas? :-(
>
> > -----Original Message-----
> > From: Gavin Carr [mailto:gavin@openfusion.com.au]
> > Sent: Tuesday, July 23, 2002 5:52 PM
> > To: Justin M. Harrison
> > Cc: embperl@perl.apache.org
> > Subject: Re: Execute
> >
> >
> > On Mon, Jul 22, 2002 at 05:54:16PM -0400, Justin M. Harrison wrote:
> > > Is there any consolidated documentation on what exactly
> Execute can
> > > do, and how files can be brought in or executed?
> Everything I have
> > > found about it seems to be scattered about Embperl,
> > Embperl::Object,
> > > etc, in both documentation and introduction...
> > >
> > > Reading through the documentation I have found several
> > different uses
> > > of it, but I am wondering if there are more
> > >
> (http://perl.apache.org/embperl/pod/doc/Embperl.-page-3-.htm#s
ect_7
> > shows " [- Execute ({ inputfile => 'mylib.htm', import => 1 }) -]",
> > then on
> >
> http://perl.apache.org/embperl/pod/doc/Embperl> Object.-page-6-.htm
"[-
> > Execute ('foot.htm') -]", and
> > http://perl.apache.org/embperl/pod/intro/Intro.-page-7-.htm
> shows [-
> > Execute ('navbar.html', 'Infos') -] as a possible use. Whats the
> > syntax for it?")
>
> In the 1.3 docs it's laid out pretty well here:
>
http://perl.apache.org/embperl/pod/doc/doc13/HTML/Embperl.-page-3-.htm#s
ect_4
I'm not sure if there's an equivalent section in the 2.0 docs yet.
Cheers,
Gavin
--
Fashion is a variable, but style is a constant - Programming Perl
---------------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
RE: Execute
Posted by Justin Harrison <sh...@doublebagel.com>.
Thanks for your response.
I am trying this in embperl 2 b8.
In the main embperl file:
[- $r = shift -]
[- $r->{content} = Execute ({'object' =>
'/home/zo/zo/lib/zoweb/content/content.pm'}) -]
[- Execute ('/home/zo/zo/web/template.epl') -]
In template.epl:
[- $r = shift -]
<html>
<head>
<title>[+ $r->{content}->title +]</title>
In content.pm:
#package zoweb::content::content;
#use strict;
sub output {
}
sub title {
}
#1;
Embperl is dying at "<title>[+ $r->{content}->title +]</title>", with:
"Error in Perl code: Can't locate object method "title" via package
"Embperl::__2" (perhaps you forgot to load "Embperl::__2"?)"
I threw Data::Dump on $r->{content} and it revealed:
bless({}, "Embperl::__2")
Any ideas? :-(
> -----Original Message-----
> From: Gavin Carr [mailto:gavin@openfusion.com.au]
> Sent: Tuesday, July 23, 2002 5:52 PM
> To: Justin M. Harrison
> Cc: embperl@perl.apache.org
> Subject: Re: Execute
>
>
> On Mon, Jul 22, 2002 at 05:54:16PM -0400, Justin M. Harrison wrote:
> > Is there any consolidated documentation on what exactly Execute can
> > do, and how files can be brought in or executed? Everything I have
> > found about it seems to be scattered about Embperl,
> Embperl::Object,
> > etc, in both documentation and introduction...
> >
> > Reading through the documentation I have found several
> different uses
> > of it, but I am wondering if there are more
> > (http://perl.apache.org/embperl/pod/doc/Embperl.-page-3-.htm#sect_7
> > shows " [- Execute ({ inputfile => 'mylib.htm', import => 1 }) -]",
> > then on
> >
> http://perl.apache.org/embperl/pod/doc/Embperl> Object.-page-6-.htm
"[-
> > Execute ('foot.htm') -]", and
> > http://perl.apache.org/embperl/pod/intro/Intro.-page-7-.htm
> shows [-
> > Execute ('navbar.html', 'Infos') -] as a possible use. Whats the
> > syntax for it?")
>
> In the 1.3 docs it's laid out pretty well here:
>
http://perl.apache.org/embperl/pod/doc/doc13/HTML/Embperl.-page-3-.htm#s
ect_4
I'm not sure if there's an equivalent section in the 2.0 docs yet.
Cheers,
Gavin
--
Fashion is a variable, but style is a constant - Programming Perl
---------------------------------------------------------------------
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: Execute
Posted by Gavin Carr <ga...@openfusion.com.au>.
On Mon, Jul 22, 2002 at 05:54:16PM -0400, Justin M. Harrison wrote:
> Is there any consolidated documentation on what exactly Execute can do,
> and how files can be brought in or executed? Everything I have found
> about it seems to be scattered about Embperl, Embperl::Object, etc, in
> both documentation and introduction...
>
> Reading through the documentation I have found several different uses of
> it, but I am wondering if there are more
> (http://perl.apache.org/embperl/pod/doc/Embperl.-page-3-.htm#sect_7
> shows " [- Execute ({ inputfile => 'mylib.htm', import => 1 }) -]", then
> on http://perl.apache.org/embperl/pod/doc/EmbperlObject.-page-6-.htm "[-
> Execute ('foot.htm') -]", and
> http://perl.apache.org/embperl/pod/intro/Intro.-page-7-.htm shows [-
> Execute ('navbar.html', 'Infos') -] as a possible use. Whats the syntax
> for it?")
In the 1.3 docs it's laid out pretty well here:
http://perl.apache.org/embperl/pod/doc/doc13/HTML/Embperl.-page-3-.htm#sect_4
I'm not sure if there's an equivalent section in the 2.0 docs yet.
Cheers,
Gavin
--
Fashion is a variable, but style is a constant - Programming Perl
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org