You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Brian Barto <br...@bartosoft.com> on 2006/02/17 17:56:36 UTC

Re: How to

> Hi all. New to embperl. So far I love it. I have the basics set up and
> working fine. base.epl and inheritence is also working great.
>
> My question is, is there a way I can store the document requested to a
> variable in the base.epl file. So if a user clicks on a link that points
> to "/embperl/aboutme/index.html", I can assign that string to a variable
> in /embperl/aboutme/base.epl or even /embperl/base.epl if
> /embperl/aboutme/base.epl does not exist. I would like to do some perl
> magic to change what is displayed depending on the document requested.
>
> I was thinking there would be a default variable that holds this info but
> I didn't find anything in the documentation.
>
> Thanks,
> Brian
>

I found it. Looks like all I needed was to use $ENV{REQUEST_URI} variable.

Thanks and keep up the good work with embperl!



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


RE: How to

Posted by Gerald Richter <ri...@ecos.de>.
Hi,
> 
> I use PerlTransHandler to do similar effect but it came from 
> pre-2.0 era and I didn't realize I can be done easely 
> directly from app init - can you please confirm I understand 
> correctly eg request for /somedir/somefile_de.html would get 
> changed to something like /cms/de/dir/somefile.html or 
> perhaps directly read it from sql database right in the app init code?
> 

You can change the filename (and all other request parameters in app init).
So you it is also possible to get the source code from a database, put it
into a scalar and tell Embperl to use that, also I didn't tried to do so.
You might also want to overwrite the get_recipe methode to change recipe,
syntax and other parameters on a per script base.

See eg/web/epwebapp.pl for examples for both technics and read
IntroEmbperl2.pod

Gerald


 
** Virus checked by BB-5000 Mailfilter ** 


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


Re: How to

Posted by RobertCZ <ro...@robert.cz>.
Gerald Richter wrote:
>>> My question is, is there a way I can store the document 
>>>       
>> requested to a variable in the base.epl file.
>>     
>
>
> Take a look at http://perl.apache.org/embperl/pod/doc/Config.-page-3-.htm,
> there is a filename and uri methods.
>
> If you have an application object you can also change the filename in the
> init method
>   

Hi,

I use PerlTransHandler to do similar effect but it came from pre-2.0 era 
and I didn't realize I can be done easely directly from app init - can 
you please confirm I understand correctly eg request for 
/somedir/somefile_de.html would get changed to something like 
/cms/de/dir/somefile.html or perhaps directly read it from sql database 
right in the app init code?

- Robert


Re: Problem with Embperl_Output_Esc_Charset

Posted by RobertCZ <ro...@robert.cz>.
Gerald Richter wrote:
> Hi,
>   
>>   I tried to put
>>
>> Embperl_Output_Esc_Charset Latin2
>>
>>   into httpd.conf and now apache refuses to start at all with 
>> no message in error.log. The same with Latin1 And the 
>> epchar.min compilation trick doesn't seem to work - I 
>> replaced epchar.c with epchar.c.min from older version but 
>> nothing changes... Please help.
>>
>>     
>
> Please use
>
> Embperl_Output_Esc_Charset 2
>
> Using text instead of numeric values is in the code, but does not work yet
> (and is not documented)
>   

Thanks, it works. I just read the changes file and was too happy to use 
it right away... without reading docs... Sorry.

- Robert

RE: Problem with Embperl_Output_Esc_Charset

Posted by Gerald Richter <ri...@ecos.de>.
Hi,
> 
>   I tried to put
> 
> Embperl_Output_Esc_Charset Latin2
> 
>   into httpd.conf and now apache refuses to start at all with 
> no message in error.log. The same with Latin1 And the 
> epchar.min compilation trick doesn't seem to work - I 
> replaced epchar.c with epchar.c.min from older version but 
> nothing changes... Please help.
> 

Please use

Embperl_Output_Esc_Charset 2

Using text instead of numeric values is in the code, but does not work yet
(and is not documented)

Gerald



 
** Virus checked by BB-5000 Mailfilter ** 


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


Problem with Embperl_Output_Esc_Charset

Posted by RobertCZ <ro...@robert.cz>.
> Diretive Embperl_Output_Esc_Charset allows to 
> generaly switch between Latin1, Latin2 and UTF-8.

Hi,

  I tried to put

Embperl_Output_Esc_Charset Latin2

  into httpd.conf and now apache refuses to start at all with no message
in error.log. The same with Latin1 And the epchar.min compilation trick
doesn't seem to work - I replaced epchar.c with epchar.c.min from older
version but nothing changes... Please help.

- Robert



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


RE: How to

Posted by Gerald Richter <ri...@ecos.de>.
> > My question is, is there a way I can store the document 
> requested to a 
> > variable in the base.epl file.


Take a look at http://perl.apache.org/embperl/pod/doc/Config.-page-3-.htm,
there is a filename and uri methods.

If you have an application object you can also change the filename in the
init method

Gerald



 
** Virus checked by BB-5000 Mailfilter ** 


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