You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Scott Chapman <sc...@mischko.com> on 2003/01/21 22:50:31 UTC

How to execute an epl as if url parms were passed?

How do I execute a epl script and pass it parms like calling a URL:
http://host/page.url?key=value

How do I pass key and value to an executed script correctly?

Thanks!
Scott


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


Re: How to execute an epl as if url parms were passed?

Posted by Carlos Kassab <ck...@glin.com.mx>.
You can load your files like this and then the variables are in the same
namespace.

Execute ({inputfile => 'config_news.epl', package => __PACKAGE__});

or you can do this:

[-

$eplsiteparams = shift; 

$eplsiteparams -> {param1} = "one";
$eplsiteparams -> {param2} = "two";

Execute ('config_news.epl');

-]

and inside file config_news.epl(file being executed) you have to do
this(once) to get the values:

[-
$eplsiteparams = shift; 
$param1 = $eplsiteparams -> {param1};
$param2 = $eplsiteparams -> {param2};
-]

.... more code


I hope it helps.

CKG






El mar, 21-01-2003 a las 16:43, Scott Chapman escribió:
> I want the same effect but I don't want to use redirection.  I want to use 
> execute instead.
> 
> Scott
> 
> On Tuesday 21 January 2003 02:40 pm, Carlos Kassab wrote:
> > Do you mean to redirect to other page, like this?:
> >
> > [-
> > $http_headers_out{Location}="index.epl?module=News;sid=$sid;order=$fdat{ord
> >er}"; -]
> >
> >
> > CKG
> >
> > El mar, 21-01-2003 a las 15:50, Scott Chapman escribió:
> > > How do I execute a epl script and pass it parms like calling a URL:
> > > http://host/page.url?key=value
> > >
> > > How do I pass key and value to an executed script correctly?
> > >
> > > Thanks!
> > > Scott
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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: How to execute an epl as if url parms were passed?

Posted by Scott Chapman <sc...@mischko.com>.
I want the same effect but I don't want to use redirection.  I want to use 
execute instead.

Scott

On Tuesday 21 January 2003 02:40 pm, Carlos Kassab wrote:
> Do you mean to redirect to other page, like this?:
>
> [-
> $http_headers_out{Location}="index.epl?module=News;sid=$sid;order=$fdat{ord
>er}"; -]
>
>
> CKG
>
> El mar, 21-01-2003 a las 15:50, Scott Chapman escribió:
> > How do I execute a epl script and pass it parms like calling a URL:
> > http://host/page.url?key=value
> >
> > How do I pass key and value to an executed script correctly?
> >
> > Thanks!
> > Scott
> >
> >
> > ---------------------------------------------------------------------
> > 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: How to execute an epl as if url parms were passed?

Posted by Carlos Kassab <ck...@glin.com.mx>.
Do you mean to redirect to other page, like this?:

[-
$http_headers_out{Location}="index.epl?module=News;sid=$sid;order=$fdat{order}"; -]


CKG


El mar, 21-01-2003 a las 15:50, Scott Chapman escribió:
> How do I execute a epl script and pass it parms like calling a URL:
> http://host/page.url?key=value
> 
> How do I pass key and value to an executed script correctly?
> 
> Thanks!
> Scott
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
-- 
Consultoría ERP BaaN Tools
Aplicaciones Internet/Intranet
http://www.glin.com.mx



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


Re: Apache httpd start error (fails on Embperl.so)

Posted by Gerald Richter <ri...@ecos.de>.
> Error: unresolvable symbol in
> /usr/common/perl5.6.0/lib/5.6.0/sgi6-irix/auto/Embperl/Embperl.so: PL_Sv
at
> /usr/common/perl5.6.0/lib/5.6.0/sgi6-irix/DynaLoader.pm line 200.
>  at (eval 4) line 3
>

Does make test of Embperl work for you?

If yes, maybe your mod_perl is compiled with another Perl version, than
Embperl

Gerald


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


Apache httpd start error (fails on Embperl.so)

Posted by Danielle Gallo <dg...@research.att.com>.
Hello,

I have Apache 1.3.27 installed with mod-perl 1.27 and Embperl 1.3.5.  I have
everything setup to use shared objects.  I'm getting the following error
message when I try to run ./apachectl start:

Syntax error on line 1235 of /www/www/apache-1.3.27/conf/httpd.conf:
Can't load
'/usr/common/perl5.6.0/lib/5.6.0/sgi6-irix/auto/Embperl/Embperl.so' for
module Embperl: 135415818:/www/www/apache-1.3.27/bin/httpd: rld: Fatal
Error: unresolvable symbol in
/usr/common/perl5.6.0/lib/5.6.0/sgi6-irix/auto/Embperl/Embperl.so: PL_Sv at
/usr/common/perl5.6.0/lib/5.6.0/sgi6-irix/DynaLoader.pm line 200.
 at (eval 4) line 3

Compilation failed in require at (eval 4) line 3.

Does anyone have any ideas?

Thanks!
Danielle



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


Re: How to execute an epl as if url parms were passed?

Posted by Cameron McBride <ca...@cwru.edu>.
> This is not right, Kee.  The URL parameters are NOT part of $fdat when you 
> POST data so passing the URL parameters to the Execute'd page in $fdat is not 
> right.

perhaps this is an ignorant statement (mine that I am about to make),
but why are you trying to use both POST and GET parameters?

Use 'hidden' parameters in something like %udat (sessions) and then use
get to do the '?key=value' URL processing - which should then be in
%fdat.  Would this solve your problem? 

Just a thought. 

Cameron

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


Re: How to execute an epl as if url parms were passed?

Posted by Gerald Richter <ri...@ecos.de>.
>  They need to arrive at the $ENV{QUERY_STRING} in order for
> them to be handled correctly by the receiving page, but I'm wondering if
>there's a Embperl way of doing this besides trying to set the environment
>variables manually before calling Execute.

In this case the only thing you can do is setting $ENV{QUERY_STRING}
manually

Gerald




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


Re: How to execute an epl as if url parms were passed?

Posted by Kee Hinckley <na...@somewhere.com>.
At 12:50 PM -0800 1/23/03, Scott Chapman wrote:
>This is not right, Kee.  The URL parameters are NOT part of $fdat when you
>POST data so passing the URL parameters to the Execute'd page in $fdat is not
>right.

I thought the problem was how to pass fdat via an Execute.

If the problem is that the POST parameters aren't in %fdat, then I'm 
confused--because they are when I use POST.

On the other hand, if the problem is that the URL parameters aren't 
in %fdat when you do a POST then can't you just grab them from 
$ENV{REQUEST_URI}?

And I don't know what this has to do with hand Executing a file. 
Although do note the documentation on the flags you should pass in 
execute to ensure it doesn't try and read STDIN again.  (I forget the 
details--I just remember seeing a comment in there at some point.)

All of this begs the question--why are you POSTing to a URL with 
arguments?  There's a reason they aren't automatically put in 
%fdat--the expected behavior is ambiguous.  Does one override the 
other?  Do you merge the results if two have the same name?  It's not 
clear.  Ignoring the URL arguments seems like the safest choice, and 
usually it's easy enough to make sure it's never an issue.  In fact 
it's often a feature, since you can easily end up at a URL with extra 
arguments, and then if the POST occurs without specifying a new URL 
(a handy thing to do when you are reusing code) you'll accidentally 
have URL arguments that you didn't anticipate--so throwing them out 
makes a lot of sense.
-- 
Kee Hinckley
http://www.puremessaging.com/        Junk-Free Email
http://commons.somewhere.com/buzz/   Writings on Technology and Society

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

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


Re: How to execute an epl as if url parms were passed?

Posted by Scott Chapman <sc...@mischko.com>.
On Wednesday 22 January 2003 06:00 pm, Kee Hinckley wrote:
> >Quote from Gerald:
> >>Embperl passes the URL parameters in %fdat. That's what it always did.
> >> Only if you have POST data (from a form) and URL parameters, you only
> >> get the POST data in %fdat
>
> Ah.  Right.  I've never been able to determine from any spec what is
> supposed to be done if there is both POST *and* GET data.  Just
> taking the POST seems as good as any solution.
>
> >Yes, I'm using HTML::Embperl::Execute.  How do I pass URL parameters to it
> >just like it was receiving data from a browser?  Do I just :
> >
> >[- Execute "/www/htdocs/page.epl?key=$value" -]
>
> That's what I was trying to say with my hurried example.  From the
> documentation it looks like you should be able to say:
>
> Execute({ inputfile => "/www/htdocs/page.epl", $fdat => {key =>
> $value}, $ffld -> ['key']});

This is not right, Kee.  The URL parameters are NOT part of $fdat when you 
POST data so passing the URL parameters to the Execute'd page in $fdat is not 
right.

I've tried passing the parameters to the Execute command like I mentioned 
above and that doesn't work.  I'm quite at a loss on how this should be 
accomplished.  They need to arrive at the $ENV{QUERY_STRING} in order for 
them to be handled correctly by the receiving page, but I'm wondering if 
there's a Embperl way of doing this besides trying to set the environment 
variables manually before calling Execute.

Anyone?

Scott



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


Re: How to execute an epl as if url parms were passed?

Posted by Kee Hinckley <na...@somewhere.com>.
At 5:29 PM -0800 1/22/03, Scott Chapman wrote:
>On Wednesday 22 January 2003 12:43 pm, you wrote:
>>  At 10:23 AM -0800 1/22/03, Scott Chapman wrote:
>>  >The URL parameters (?key=value....) are not passed in to fdat with a form
>>  > POST method.  I don't want them to go into fdat when I do an execute
>>  > either.  They need to be passed to execute as key=value parameters just
>>  > as if the page were being hit from the web with the same parameters.
>>
>>  You've lost me here.
>>
>>  First of all, are we talking about HTML::Embperl::Execute, or are you
>>  actually running a program that you want to have read parameters from
>>  STDIN?
>>
>>  POST certainly sets %fdat normally.  And the values are available to
>>  any Embperl::Execute subroutines directly.
>
>Quote from Gerald:
>
>>Embperl passes the URL parameters in %fdat. That's what it always did. Only
>>if you have POST data (from a form) and URL parameters, you only get the
>>POST data in %fdat

Ah.  Right.  I've never been able to determine from any spec what is 
supposed to be done if there is both POST *and* GET data.  Just 
taking the POST seems as good as any solution.

>
>Yes, I'm using HTML::Embperl::Execute.  How do I pass URL parameters to it
>just like it was receiving data from a browser?  Do I just :
>
>[- Execute "/www/htdocs/page.epl?key=$value" -]

That's what I was trying to say with my hurried example.  From the 
documentation it looks like you should be able to say:

Execute({ inputfile => "/www/htdocs/page.epl", $fdat => {key => 
$value}, $ffld -> ['key']});

-- 

Kee Hinckley - Somewhere.Com, LLC
Business: http://consulting.somewhere.com/
Writings: http://commons.somewhere.com/buzz/

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

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


Re: How to execute an epl as if url parms were passed?

Posted by Scott Chapman <sc...@mischko.com>.
On Wednesday 22 January 2003 12:43 pm, you wrote:
> At 10:23 AM -0800 1/22/03, Scott Chapman wrote:
> >The URL parameters (?key=value....) are not passed in to fdat with a form
> > POST method.  I don't want them to go into fdat when I do an execute
> > either.  They need to be passed to execute as key=value parameters just
> > as if the page were being hit from the web with the same parameters.
>
> You've lost me here.
>
> First of all, are we talking about HTML::Embperl::Execute, or are you
> actually running a program that you want to have read parameters from
> STDIN?
>
> POST certainly sets %fdat normally.  And the values are available to
> any Embperl::Execute subroutines directly.

Quote from Gerald:

>Embperl passes the URL parameters in %fdat. That's what it always did. Only
>if you have POST data (from a form) and URL parameters, you only get the
>POST data in %fdat

Yes, I'm using HTML::Embperl::Execute.  How do I pass URL parameters to it 
just like it was receiving data from a browser?  Do I just :

[- Execute "/www/htdocs/page.epl?key=$value" -]

?

Thanks!
Scott

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


Re: How to execute an epl as if url parms were passed?

Posted by Kee Hinckley <na...@somewhere.com>.
At 10:23 AM -0800 1/22/03, Scott Chapman wrote:
>The URL parameters (?key=value....) are not passed in to fdat with a form POST
>method.  I don't want them to go into fdat when I do an execute either.  They
>need to be passed to execute as key=value parameters just as if the page were
>being hit from the web with the same parameters.

You've lost me here.

First of all, are we talking about HTML::Embperl::Execute, or are you 
actually running a program that you want to have read parameters from 
STDIN?

POST certainly sets %fdat normally.  And the values are available to 
any Embperl::Execute subroutines directly.
-- 

Kee Hinckley - Somewhere.Com, LLC
Business: http://consulting.somewhere.com/
Writings: http://commons.somewhere.com/buzz/

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

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


Re: How to execute an epl as if url parms were passed?

Posted by Scott Chapman <sc...@mischko.com>.
The URL parameters (?key=value....) are not passed in to fdat with a form POST 
method.  I don't want them to go into fdat when I do an execute either.  They 
need to be passed to execute as key=value parameters just as if the page were 
being hit from the web with the same parameters.  

Does anyone know how to do this?

Scott


On Tuesday 21 January 2003 05:28 pm, Kee Hinckley wrote:
> Although I haven't done it, the docs on Execute say you can pass
> 	ffld => []
> 	fdat => {}
> and it will set them up.


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


Re: How to execute an epl as if url parms were passed?

Posted by Kee Hinckley <na...@somewhere.com>.
Although I haven't done it, the docs on Execute say you can pass
	ffld => []
	fdat => {}
and it will set them up.
-- 

Kee Hinckley - Somewhere.Com, LLC
Business: http://consulting.somewhere.com/
Writings: http://commons.somewhere.com/buzz/

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

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