Gossamer Forum
Quote Reply
Function Tags
Basically I created a module - Dbsql::stats and am calling the routines using function tags.

eg..

<%Dbsql::stats::routine('args')%>

....I have about 8 or 10 tags in a template and about 6-7 of them all work fine. However I then created a new subroutine in stats.pm and when I call it using a template tag it says the routine can't be found in stats.pm even though it is definitely there.

The subroutine is called ave. Im using the following tag:

<%Dbsql::stats::ave%>

...and it just gives an error. I've also tried adding () after ave...same thing.

Any help is appreciated thanks.

Last edited by:

Paul: Jun 28, 2002, 9:59 AM
Quote Reply
Re: [Paul] Function Tags In reply to
Can you post error message? By the way, double check the syntax.

B.

Last edited by:

TheStone: Jun 28, 2002, 4:07 PM
Quote Reply
Re: [TheStone] Function Tags In reply to
Error: Unable to load module: Dbsql::stats. Reason:
Error: No subroutine 'Dbsql::stats::ave' in 'Dbsql/stats.pm',
Error: No subroutine 'Dbsql::stats::ave' in 'Dbsql.pm'

I've double checked everything over and over. I can pm you the html/pm file if needed.
Quote Reply
Re: [Paul] Function Tags In reply to
Can you send me the html and pm files? I'll have a look at them.

B.
Quote Reply
Re: [Paul] Function Tags In reply to
just out of curiosity, does the stats module pass a perl -c test?
Quote Reply
Re: [Aki] Function Tags In reply to
TheStone spotted my stupid mistake, thanks :)

The error message was a bit mis-leading though....maybe $@ should be returned to the template for syntax errors rather than just "Unable to load bla bla : subroutine doesn't exist" ....because thats not quite true.

I think if it had said syntax error I probably wouldn't have even had to post this thread.

Last edited by:

Paul: Jul 4, 2002, 1:18 AM
Quote Reply
Re: [Paul] Function Tags In reply to
I get that message all the time.

Yeah, the message is a bit misleading, but I think the big problem is error-pass through to the end user is a real pain and at times, a security hole. Crazy
Quote Reply
Re: [Aki] Function Tags In reply to
I see your point...maybe just a quick check on $@ to see if it starts with "syntax error"...then return a custom error rather than all of $@ with sensitive info in.

I don't know just trying to think of something that explains the error a bit more clearly Angelic.

Last edited by:

Paul: Jul 5, 2002, 12:11 PM
Quote Reply
Re: [Paul] Function Tags In reply to
Not trying to block ya or anything, just giving reasons for why the error kinda is the way it is.

In checking the latest GT::Template modules, Good News, it appears the errors are now reported to the user. A set of changes were made to the _call_func routine in Template.pm, so if you want to patch yours up for the moment, you can fix things up in there.
Quote Reply
Re: [Aki] Function Tags In reply to
>>
Not trying to block ya or anything, just giving reasons for why the error kinda is the way it is.
<<

Yep I understand.

I notice Gossamer Forum and (I think?) Links SQL already do that kind of reporting so it must just have been an older version of the parser with DBMAN SQL perhaps?

Thanks.