[ic] How to Call a GlobalSub?

Sam Hui shui@lunamedium.com
Mon, 26 Feb 2001 18:40:00 -0800


Hi,

I'm having a bit of trouble calling a GlobalSub, even the one included, ie.
test_global_sub which is declared like this in the interchange.cfg:

Variable   DEBUG     1
#ifdef @DEBUG
GlobalSub sub test_global_sub { return "Test of global subroutine OK."; }
#endif

Then in a test.html file:

hello!
[perl arg=sub interpolate=1]
test_global_sub()
[/perl]
goodbye!

I would get this in the log file:

192.168.0.84 e3JGkEeq:192.168.0.84 - [26/February/2001:17:29:30 -0800]
store3 /cgi-bin/store3/test.html Runtime error: Unable to create sub named
"" at //usr/lib/interchange/lib/Vend/Interpolate.pm line 1656.

If I use this syntax ([perl sub] subname arg [/perl] from
http://developer.akopia.com/cgi-bin/ic/docfly.html?mv_arg=reference24%2e16)

[perl sub] test_global_sub() [/perl]

I would get this in the log file:

192.168.0.84 e3JGkEeq:192.168.0.84 - [26/February/2001:18:23:08 -0800]
store3 /cgi-bin/store3/test.html Safe: Unable to create sub named
"*MVSAFE::test_global_sub" at (eval 319) line 1.
>
>  test_global_sub()
>

Am I doing this correctly?  If so, is there some other flags I have to set
in the interchange.cfg/catalog.cfg??  Any suggesstions or comments in the
right direction would be much appreciated.


-Sam