[EMAIL PROTECTED] wrote:

> Hi,
>
> I'm having a very frustrating time with a small test program I'm trying to
> write. I'm using ActivePerl 5. I'm sure the answer is simple and I'll kick
> myself when someone clarifies the matter, but here goes anyway:
>
> The error message is:
>
> "Undefined subroutine &main::html_chars called at test2.pl line 104."
>
> The code starts:
>
> use strict;
> use warnings;
> use DBI;
>
> After connection to the database and extraction of relevant data into a file
> (which works), I call the first subroutine thus:
>
> &html_chars;
>
> The actual sub routine is further down on the script page, but I don't want
> to put the sub routines before the main program unless I really have to.
>
> I read the manual on subroutines, and tried all the variations of the
> phrases listed under "synopsis" and none made any difference to the problem.
> So how does one define a subroutine?

Since you have not shown you subroutine declaration I can only guess
By subroutines manpage I guess you mean perlsub, if you have tried all options given
there one possible problem is that the html_chars falls under a different package.
Search for the string package in your script and check if html_chars falls in its 
scope.
If so you will have call it as <package name>::html_chars

>
>
> Thanks.
>
> Anne Webel
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to