Gerald Richter wrote:
>
> > Gerald, I am having a problem with [$ sub $] and EmbperlObject. Let me
> > say first that this minimal case does in fact work as it should. There
> > is something inexplicable going on however in my (much larger) project.
> > If you look at this minimal case though I think you will see why I don't
> > think this is a problem with my code.
> >
>
> Neil, I didn't had the time to look thru that in detail, but I do it as soon
> as possible and let you know
Gerald,
Sorry about the repeated emails regarding this issue, but I continue to
play with the problem and have come up with more possible behavioral
clues. In my previous email, I said that Execute('#foo') worked.
However, I now discover that it ONLY works if [$ sub foo $] is in the
same file as the call to Execute('#foo'). When I move the [$ sub $]
definition out into a subroutines file (which is Executed to import the
subs) then I consistently get an error "Call to unknown Embperl macro
foo" on Execute('#foo'). This happens whatever form I use to import the
subroutines. I have tried the following combinations, to no avail:
[- Execute ({inputfile => 'macros.html', import => 0}) -]
[- Execute ({inputfile => 'macros.html', import => 1}) -]
[- Execute ({inputfile => 'macros.html', package => __PACKAGE__, import
=> 0}) -]
[- Execute ({inputfile => 'macros.html', package => __PACKAGE__, import
=> 1}) -]
Also, the call works if I import using import=>1 and just call it using
[- foo -].
I am increasingly flummoxed by all this, and starting to doubt my own
sanity here. I am looking closely at all my files to see if there is
something incredibly stupid that I am doing. It seems that every day I
am seeing a new behavior. I really hope that this is not something on my
end. But the previous example was reproducible even on my minimal test
server, and using Embperl rather than EmbperlObject. In other words,
this was simply using the following httpd.conf settings:
<VirtualHost 10.1.1.3:80>
ServerName test.dev.nilspace.com
SSLDisable
ServerAdmin [EMAIL PROTECTED]
DocumentRoot /www/nilspace/com/test
DirectoryIndex index.html
ErrorLog /www/nilspace/com/logs/error_log
TransferLog /www/nilspace/com/logs/access_log
PerlSetEnv EMBPERL_ESCMODE 3
PerlSetEnv EMBPERL_OPTIONS 16
PerlSetEnv EMBPERL_MAILHOST mail.nilspace.com
PerlSetEnv EMBPERL_OBJECT_BASE base.html
PerlSetEnv EMBPERL_DEBUG 66609149
</VirtualHost>
# Set EmbPerl handler for test directory
<Directory "/www/nilspace/com/test/">
<FilesMatch ".*\.(html)$">
SetHandler perl-script
PerlHandler HTML::Embperl
Options ExecCGI
</FilesMatch>
</Directory>
... and the following files:
index.html:
[- Execute ({inputfile => 'macros.html', import => 1}) -]
[- Execute ('#macro_test') # error: Call to unknown Embperl macro
macro_test -]
[- macro_test # ok -]
macros.html:
[$ sub macro_test $]
macro_test
[$ endsub $]
Once again, the following DOES work:
index.html:
[$ sub macro_test $]
macro_test
[$ endsub $]
[- Execute ('#macro_test') # ok -]
I am using 1.3.0.
HTH
-Neil
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]