Now that I got an idea about configuration, lets move on to usage.  
(thanks!!)

What I had in mind for Embperl (using the Embperl::Object stuff) was an
inheritance tree for the request object.  But I want my base.epl to be
in the middle: 
(the order is via my understanding of precedence, most -> least)

  REQUESTED PAGE  -->    base.epl    --> defaults.epl
 (the .html file)    

So, the requested page could change what it likes, base.epl is used as the
template for the html formatting (most of the request objects features
are used here) and the defaults.epl is where site defaults and constants
are stored.

I was not able to achieve this.  I tried several methods, described
below.

1. Importing the code via 'Execute':
    (in base.epl)
    Execute({inputfile=>'defaults.epl', import=>1);

   Never got this to work at all, it just seems to silently fail -- and
   the subroutines never became part of the namespace of the file.  

2. Adding to the ISA array via 'Execute':   
    (in base.epl)
    Execute ({isa=>'defaults.epl'});
   
   Now, base.epl (being the EMBPERL_OBJECT_BASE) does not seem to like
   having an 'isa' assignment in it.  I get some error in embperl.log
   about the ISA being corrupted.  

   I was able to correctly use this directive outside of a base.epl
   file, and it works as expected (ie as documented).

3. Just plain 'Execute'ing the code:
    (in base.epl)
    Execute ('defaults.epl');

   I didn't really expect this to work, but I thought what the hell.
   I did learn that the only files to contribute to the requested object
   namespace are the REQUESTED PAGE and the EMBPERL_OBJECT_BASE.  
   (not matter how many 'Execute's are in the base.epl) Is this correct? 

What I was able to do, albeit in a different way -- was to incorporate
the 'defaults.epl' as a separate object -- to be called when needed.  So
any file that wanted to use 'defaults', would do the following:
  [- $default = Execute({object=>'defaults.epl'}); -]

And it would now have these available via the $defaults object.   

This is acceptable, but I still think it would be better to implement my
original idea.  Is it possible to import code (with commands in
'base.epl') into the request object namespace?  The only way I have been
able to do this is by explicit declaration within the 'base.epl' file.

Am I missing something?

If there are any readers that have a better idea for an implementation,
or comments on mine -- input is welcome!

Cameron

PS -- this was all done using my test environment (in case that matters):  
Embperl: 2.0b5 / 2.0b7 (some under 1.3.4)
Perl:    5.6.0 (mod_perl 1.26)
Apache:  1.3.22
Configs: (analogous to previous posts - see them for details)


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to