You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Steve Sapovits <st...@comcast.net> on 2006/04/28 11:19:49 UTC

Embperl::Object environment variables

Now that I can build (thanks Gerald) I'm trying to set up an
object oriented page hierarchy.  I get the basics to work.
However, the environment settings in my Apache <VirtualHost>
section don't appear to be having any effect.  For example,
I set logging levels and get nothing and I have to use the
default object base '_base.epl' instead of the sample I set
up 'base.epl' (and I've tried other names).  I changed other
settings in the <VirtualHost> to verity it's getting used as
a whole.  Those changes did take effect.  That leads me to
believe I need some other Embperl setting.  My <VirtualHost>
section looks like this:

NameVirtualHost *:80

<VirtualHost *:80>
     ServerName       secdevfdsapp01.gspt.net
     ServerAdmin      sapovitss@xxxxxx.com
     DocumentRoot     /feeds/htdocs
     DirectoryIndex   index.html
     ErrorLog         logs/error_log
     TransferLog      logs/access_log
     PerlSetEnv       EMBPERL_ESCMODE 0
     PerlSetEnv       EMBPERL_OPTIONS 16
     PerlSetEnv       EMBPERL_MAILHOST localhost
     PerlSetEnv       EMBPERL_OBJECT_BASE base.epl
     PerlSetEnv       EMBPERL_OBJECT_FALLBACK notfound.html
     PerlSetEnv       EMBPERL_DEBUG 10477
     PerlSetEnv       EMBPERL_VIRTLOG 10477
</VirtualHost>

I've changed things like DocumentRoot to test the overall
use of the section.

Any ideas appreciated.  As noted before, this is Apache 2.2.0,
Embperl 2.2.0, mod_perl 2.0.2.

-- 
Steve Sapovits  steves06@comcast.net

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


RE: Subroutine issues

Posted by Gerald Richter <ri...@ecos.de>.
> 
> I am having some issues with Embperl 2.2.0 and subroutines.
> 
> I used to be able to call a subroutine from another file like 
> this in Embperl 1.3.6:
> [- Execute ({ inputfile => 'displayedit.html', import => 1 }) -]
> [- EditReport -]
> 
> displayedit.html
> [$ sub EditReport $]
> 
>      (code & html)
> 
> [$ endsub $]
> 
> 
> 
> Under 2.2.0, I get a blank page.  Once in a great while it 
> will actually work.
> 
> If I do this to the displayedit.html file:
> 
> <BR>
> Loaded file
> <BR>
> [$ sub EditReport $]
> 
>      (code)
> 
> [$ endsub $]
> 
> I will see the line "Loaded file", but nothing from the subroutine.
> 
> Any ideas?
> 

Mmmh, looks like a bug. I try to reproduce it here and then will get back to
you

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


Subroutine issues

Posted by Keven Murphy <mu...@gdls.com>.
Hello,

I am having some issues with Embperl 2.2.0 and subroutines.

I used to be able to call a subroutine from another file like this in
Embperl 1.3.6:
[- Execute ({ inputfile => 'displayedit.html', import => 1 }) -]
[- EditReport -]

displayedit.html
[$ sub EditReport $]

     (code & html)

[$ endsub $]



Under 2.2.0, I get a blank page.  Once in a great while it will actually
work.

If I do this to the displayedit.html file:

<BR>
Loaded file
<BR>
[$ sub EditReport $]

     (code)

[$ endsub $]

I will see the line "Loaded file", but nothing from the subroutine.

Any ideas?

Keven Murphy
murphyk@gdls.com

Murphy's Law
((U+C+I)x(10-S))/20xAx1/(1-sin(F/10))
U = Urgency    C = Complexity
I = Importance S = Skill
F = Frequency  A = Aggravation



This is an e-mail from General Dynamics Land Systems. It is for the intended recipient only and may contain confidential and privileged information.  No one else may read, print, store, copy, forward or act in reliance on it or its attachments.  If you are not the intended recipient, please return this message to the sender and delete the message and any attachments from your computer. Your cooperation is appreciated.

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


Re: Embperl::Object environment variables

Posted by Steve Sapovits <st...@comcast.net>.
Kathryn Andersen wrote:

> I believe the preferred method of setting things with Embperl 2.x and
> Apache 2.x is NOT to use PerlSetEnv but to use things like
>  
> Embperl_Object_Base base.epl
> 
> rather than
> 
> PerlSetEnv       EMBPERL_OBJECT_BASE base.epl
> 
> This is because by default, Embperl 2.x using mod_perl does not get its
> settings from the environment (unlike 1.x)
> 
> If you want it to use the environment, you have to set
> 
> Embperl_Useenv
> 
> to true.
> 
> This page is helpful:
> http://perl.apache.org/embperl/pod/doc/Config.htm

Thanks Kathryn.  This led me down the right path.  A few pointers for
anyone else hitting this, all of which I eventually found in the docs

but which may be useful to summarize:

(1)  I was missing the 'LoadModule embperl_module' directive.

(2)  I was missing the 'PerlModule Embperl' directive.

(3)  I needed to add a EMBPERL_APPNAME setting within my <VirtualHost>
      set of Embperl settings (at the top).  The docs explain the need
      for this with Apache/mod_perl 2.

Thanks again.

-- 
Steve Sapovits    steves06@comcast.net

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


Re: Embperl::Object environment variables

Posted by Kathryn Andersen <ka...@katspace.homelinux.org>.
On Fri, Apr 28, 2006 at 05:19:49AM -0400, Steve Sapovits wrote:
> 
> However, the environment settings in my Apache <VirtualHost>
> section don't appear to be having any effect.  For example,

> a whole.  Those changes did take effect.  That leads me to
> believe I need some other Embperl setting.  My <VirtualHost>
> section looks like this:
> 
> NameVirtualHost *:80
> 
> <VirtualHost *:80>
>     ServerName       secdevfdsapp01.gspt.net
>     ServerAdmin      sapovitss@xxxxxx.com
>     DocumentRoot     /feeds/htdocs
>     DirectoryIndex   index.html
>     ErrorLog         logs/error_log
>     TransferLog      logs/access_log
>     PerlSetEnv       EMBPERL_ESCMODE 0
>     PerlSetEnv       EMBPERL_OPTIONS 16
>     PerlSetEnv       EMBPERL_MAILHOST localhost
>     PerlSetEnv       EMBPERL_OBJECT_BASE base.epl
>     PerlSetEnv       EMBPERL_OBJECT_FALLBACK notfound.html
>     PerlSetEnv       EMBPERL_DEBUG 10477
>     PerlSetEnv       EMBPERL_VIRTLOG 10477
> </VirtualHost>

> Any ideas appreciated.  As noted before, this is Apache 2.2.0,
> Embperl 2.2.0, mod_perl 2.0.2.

I believe the preferred method of setting things with Embperl 2.x and
Apache 2.x is NOT to use PerlSetEnv but to use things like
 
Embperl_Object_Base base.epl

rather than

PerlSetEnv       EMBPERL_OBJECT_BASE base.epl

This is because by default, Embperl 2.x using mod_perl does not get its
settings from the environment (unlike 1.x)

If you want it to use the environment, you have to set

Embperl_Useenv

to true.

This page is helpful:
http://perl.apache.org/embperl/pod/doc/Config.htm

Kathryn Andersen
-- 
 _--_|\     | Kathryn Andersen	<http://www.katspace.com>
/      \    | 
\_.--.*/    | GenFicCrit mailing list <http://www.katspace.com/gen_fic_crit/>
      v     | 
------------| Melbourne -> Victoria -> Australia -> Southern Hemisphere
Maranatha!  |	-> Earth -> Sol -> Milky Way Galaxy -> Universe

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


Re: Embperl::Object environment variables

Posted by Keven Murphy <mu...@gdls.com>.
Steve,

Hey just a note on the DirectoryIndex line. Mod_perl does something to the
DirectoryIndex variable. It doesn't work. I found a couple websites with a
work around.

What I am using is the mod_rewrite and the following lines:
ReWriteEngine on
ReWriteRule ^(.*)/$ $1/index.html


Keven Murphy
murphyk@gdls.com

Murphy's Law
((U+C+I)x(10-S))/20xAx1/(1-sin(F/10))
U = Urgency    C = Complexity
I = Importance S = Skill
F = Frequency  A = Aggravation

On Fri, 28 Apr 2006, Steve Sapovits wrote:

>
> Now that I can build (thanks Gerald) I'm trying to set up an
> object oriented page hierarchy.  I get the basics to work.
> However, the environment settings in my Apache <VirtualHost>
> section don't appear to be having any effect.  For example,
> I set logging levels and get nothing and I have to use the
> default object base '_base.epl' instead of the sample I set
> up 'base.epl' (and I've tried other names).  I changed other
> settings in the <VirtualHost> to verity it's getting used as
> a whole.  Those changes did take effect.  That leads me to
> believe I need some other Embperl setting.  My <VirtualHost>
> section looks like this:
>
> NameVirtualHost *:80
>
> <VirtualHost *:80>
>      ServerName       secdevfdsapp01.gspt.net
>      ServerAdmin      sapovitss@xxxxxx.com
>      DocumentRoot     /feeds/htdocs
>      DirectoryIndex   index.html
>      ErrorLog         logs/error_log
>      TransferLog      logs/access_log
>      PerlSetEnv       EMBPERL_ESCMODE 0
>      PerlSetEnv       EMBPERL_OPTIONS 16
>      PerlSetEnv       EMBPERL_MAILHOST localhost
>      PerlSetEnv       EMBPERL_OBJECT_BASE base.epl
>      PerlSetEnv       EMBPERL_OBJECT_FALLBACK notfound.html
>      PerlSetEnv       EMBPERL_DEBUG 10477
>      PerlSetEnv       EMBPERL_VIRTLOG 10477
> </VirtualHost>
>
> I've changed things like DocumentRoot to test the overall
> use of the section.
>
> Any ideas appreciated.  As noted before, this is Apache 2.2.0,
> Embperl 2.2.0, mod_perl 2.0.2.
>
> --
> Steve Sapovits  steves06@comcast.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
>
>


This is an e-mail from General Dynamics Land Systems. It is for the intended recipient only and may contain confidential and privileged information.  No one else may read, print, store, copy, forward or act in reliance on it or its attachments.  If you are not the intended recipient, please return this message to the sender and delete the message and any attachments from your computer. Your cooperation is appreciated.

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