[ic] still unable to call global subroutines in html files

Timothy Cassidy 6tc1@qlink.queensu.ca
Mon, 12 Mar 2001 22:23:34 -0500 (EST)


I think you may have misunderstood my question.

I have set
AllowGlobal for my catalog that I am working in.  I did this by putting
AllowGlobal construct
on a single line.  The catalog I am working with is called construct.

In addition I have defined a Global subroutine (in truth it was already
defined in the interchange.cfg file
GlobalSub sub test_global_sub { return 'Test of global subroutine OK.' }

now when I put
[perl sub]
test_global_sub();
[/perl]

in one of my html files (aboutus.html), I get the following error:

192.168.0.13 I7nXoc3U:192.168.0.13 - [12/March/2001:21:56:53 -0500]
construct /c
gi-bin/construct/aboutus.html Safe: Undefined subroutine
&MVSAFE::test_global_su
b called at (eval 239) line 6.
>
>
> test_global_sub();
>
>
192.168.0.13 I7nXoc3U:192.168.0.13 - [12/March/2001:21:56:53 -0500]
construct /c
gi-bin/construct/aboutus.html Safe: Undefined subroutine
&MVSAFE::test_global_su
b called at (eval 239) line 6.
>
>
> test_global_sub();
>
>
192.168.0.13 I7nXoc3U:192.168.0.13 - [12/March/2001:21:56:53 -0500]
construct /c
gi-bin/construct/aboutus.html Runtime error: Can't call method
"open_table" on a
n undefined value at //usr/lib/interchange/lib/Vend/Data.pm line 872.
>
192.168.0.13 I7nXoc3U:192.168.0.13 - [12/March/2001:21:56:53 -0500]
construct /c
gi-bin/construct/aboutus.html Runtime error: Can't call method
"open_table" on a
n undefined value at //usr/lib/interchange/lib/Vend/Data.pm line 872.
>

I don't know why I get the error twice, but I clear the error.log file
each time I restart the interchange server.  Anyway, perhaps I have
misunderstood your answer, but I think it is just that I am not calling
the functions correctly.  For instance, are my user tags correct?  I found
the
[perl sub]
tag in one of the documents.  But it seems strange that it is ended with a
regular end perl tag.

I actually do know how to use grep and I tried your suggestion of grep'ing
on the various pm files that are part of interchange, and I did find code
that referred to MVSAFE, but I am unsure as to what to do with that code.
I wouldn't have thought that I should have to alter the code in the
interchange libraries (/usr/lib/interchange/, /usr/local/interchange/lib/)

Thanks very much for your help,
Tim

On Sat, 10 Mar 2001 cfm@maine.com wrote:

> On Sat, Mar 10, 2001 at 08:44:01PM -0500, Timothy Cassidy wrote:
> > This is a stupid question, but how do you call one of these
> > GlobalSub subroutines (in your interchange.cfg file)?  I have been trying
> > to call these subroutines from within a section of my html pages like
> > this:
> > [perl sub]
> > test();
> > [/perl]
> >
> > I also tried adding this line:
> > &charge=custom test
> > to my profiles.order file.
> >
> > But regardless this fails with an error like this:
> > 192.168.0.13 vqMqdKVZ:192.168.0.13 - [10/March/2001:20:25:08 -0500]
> > construct /c
> > gi-bin/construct/aboutus.html Safe: Undefined subroutine &MVSAFE::test
>                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> You probably need AllowGlobal in your interchange.cfg file.
>
> If one is writing embedded perl one should learn how to grep through
> the code to find something like that and how to systematically
> isolate the issue.
>
> grep MVSAFE *.pm
>
> Yeah it would be nice if IC logs were more syslog typical,
> __FILE__:__LINE__ message.  We've never run it with the syslog
> option (there is one isn't there), maybe it already is.
>
> --
>
> Christopher F. Miller, Publisher                             cfm@maine.com
> MaineStreet Communications, Inc         208 Portland Road, Gray, ME  04039
> 1.207.657.5078                                       http://www.maine.com/
> Content management, electronic commerce, internet integration, Debian linux
>
> _______________________________________________
> Interchange-users mailing list
> Interchange-users@lists.akopia.com
> http://lists.akopia.com/mailman/listinfo/interchange-users
>