Gerald Richter wrote:
>
> Neil,
>
> the main problem with your idea, that I currently have, is in which files
> these globals should be accessable. As I understand you right, you would
> make it accessable from all files which are used in one request, while this
> makes sense, it is not very efficient. Normaly I try to setup all those
> things only once, so any further request doesn't have to do it again. If I
> would resetup those globals (which would be actualy aliases to one global),
> for every request I can simply do this with all files which are handled in
> this request, but if I don't want to resetup it every time, there must be
> some way to tell Embperl, which pages belong together and should share the
> same globals.
Hi Gerald,
I understand your concern... let me first say that I don't really have
strong feelings about this feature yet - I am very open to someone
telling me it's just a bad idea all round. But as for your main point
here, regarding efficiency: The first thing that came into my head is
what we do in EmbperlObject to implement inheritance:
[! Execute ({isa => '../subs.html'}) !]
This is used to enable a feature which is not required for all pages.
So, how about a similar thing for the sharing of variables. Something
like this:
[! Execute ({shares => 'global'}) !]
This would tell Embperl that this file should share whatever is in
%global. I don't know if this method would work; I think it would need
to be in [! !] block so that Embperl could set all this up before the
first execute (not too sure about the ordering of events here with
regard to compiling...).
This method, if it is practical, would enable different hashes (e.g.
%global, %foo, %bar) to be set up and the variables set therein to be
shared between different files, on a per-file basis. Each file would
tell Embperl which variable sets it wishes to share (i.e. multiple calls
to Execute() if more than one).
What do you think? Would this work?
Thanks!
-Neil
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]