You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Robert <ro...@robert.cz> on 2000/06/15 08:24:04 UTC
Re: EmbperlObject: parameters? (idea)
Gerald Richter wrote:
> ...
>
> Rewrite it as
>
> <title>[- Execute ('*#title') -]</title>
>
> and put a
>
> Execute (filename => '*', 'import' => 0') ;
>
> at the top of base.html (this line is only neccessary for now, it will be
> automaticly executed in the next release)
>
> your test.html defines
>
> [$sub title $] My Title goes here [$endsub$]
>
> ...
Hi,
I'm playing with your solution and while it seems to work, but I've
found three more problems:
- I need to post-process result of the Execute so I try
<title>[- Execute({ inputfile => '*#title', output => \$x }) -] [+
process($x) +]</title>
but EmbperlObject complains file '*#title' doesn't exists. Fortunately
following works
<title>[- Execute({ inputfile => '*', sub => 'title', output => \$x })
-]
[+ process($x) +]</title>
- I'm having problems with caching Execute results: even when I turn it
off with mdate => undef
<title>[- Execute({ inputfile => '*', sub => 'title', output => \$x,
mtime => undef }) -]
[+ process($x) +]</title>
it still shows old values. The problem matifests itself in several
browsers but reload would always fix it: I guess it must be
EmbperlObject problem. (I'll make simplified case if it's necessary).
- Irregularly but quite often EmbperlObject fails with 'function not
defined' even if the function is normal perl sub defined in the
base.html - reload always fixes it.
And finally I guess it might be a good idea to (make possible to) export
base.html subs so they're available in the pages.
- Robert
RE: EmbperlObject: parameters? (idea)
Posted by Gerald Richter <ri...@ecos.de>.
> Most my problems with EmbperlObject
> come from parameters passing around and subs importing/exporting, it can
> mostly be worked around, but it looses the elegance of the EmbperlObject
> idea.
>
Next release will bring you the elegance back (hopefully).
Gerald
Re: EmbperlObject: parameters? (idea)
Posted by Robert <ro...@robert.cz>.
Gerald Richter wrote:
>
> > - I'm having problems with caching Execute results: even when I turn it
> > off with mdate => undef
> >
> > <title>[- Execute({ inputfile => '*', sub => 'title', output => \$x,
> > mtime => undef }) -]
> > [+ process($x) +]</title>
> >
> > it still shows old values. The problem matifests itself in several
> > browsers but reload would always fix it: I guess it must be
> > EmbperlObject problem. (I'll make simplified case if it's necessary).
> >
>
> This has nothing to do with the mtime paramter. mtime only is responsible
> for the caching of the compiled perl code, but _not_ for the result. The
> page is always executed and should compute a new result. Looks like there
> must be another reason. Maybe a problem with closures?
>
> > - Irregularly but quite often EmbperlObject fails with 'function not
> > defined' even if the function is normal perl sub defined in the
> > base.html - reload always fixes it.
> >
>
> How do you call the functions? Where are the functions definied? In the same
> file?
No closures, some functions are defined in the same file, some are
imported. It happens on my devel server only, I have just concluded I
can't reproduce it on my production server. There is only one real
difference between those: DocRoot on my devel server is windows disk
mounted through Samba. Samba does have small some problems on my devel
server (sometimes it doesn't see things have changed on the mounted disk
etc) so I tend to think both problems are somehow samba-related. I don't
really need Samba (too lazy I guess) so I am not going to investigate it
further unless it happens on production server or somebody is terribly
interested.
> > And finally I guess it might be a good idea to (make possible to) export
> > base.html subs so they're available in the pages.
> >
>
> I plan to add more features at the end of the month (or starting of july).
> Then I will add some scheme of inherance/import/export, not quite sure
> what's the best yet.
These pages I'm talking about go online tommorow, I'm changing back to
plain Embperl right now. I'm going to work on them some more in a month
or two and I guess I'll try to put it back into the EmbperlObject, esp.
if some cool new stuff comes out. Most my problems with EmbperlObject
come from parameters passing around and subs importing/exporting, it can
mostly be worked around, but it looses the elegance of the EmbperlObject
idea.
- Robert
Re: EmbperlObject: parameters? (idea)
Posted by Gerald Richter <ri...@ecos.de>.
Hi,
>
> I'm playing with your solution and while it seems to work, but I've
> found three more problems:
>
> - I need to post-process result of the Execute so I try
>
> <title>[- Execute({ inputfile => '*#title', output => \$x }) -] [+
> process($x) +]</title>
>
> but EmbperlObject complains file '*#title' doesn't exists. Fortunately
> following works
>
> <title>[- Execute({ inputfile => '*', sub => 'title', output => \$x })
> -]
> [+ process($x) +]</title>
>
Yes, the *#title syntax only works in the short form. i.e. Execute
('*#title') ;
> - I'm having problems with caching Execute results: even when I turn it
> off with mdate => undef
>
> <title>[- Execute({ inputfile => '*', sub => 'title', output => \$x,
> mtime => undef }) -]
> [+ process($x) +]</title>
>
> it still shows old values. The problem matifests itself in several
> browsers but reload would always fix it: I guess it must be
> EmbperlObject problem. (I'll make simplified case if it's necessary).
>
This has nothing to do with the mtime paramter. mtime only is responsible
for the caching of the compiled perl code, but _not_ for the result. The
page is always executed and should compute a new result. Looks like there
must be another reason. Maybe a problem with closures?
> - Irregularly but quite often EmbperlObject fails with 'function not
> defined' even if the function is normal perl sub defined in the
> base.html - reload always fixes it.
>
How do you call the functions? Where are the functions definied? In the same
file?
> And finally I guess it might be a good idea to (make possible to) export
> base.html subs so they're available in the pages.
>
I plan to add more features at the end of the month (or starting of july).
Then I will add some scheme of inherance/import/export, not quite sure
what's the best yet.
Gerald