Re: Including a module
by John Erjavec V <jev(at)pconline.com>
|
Date: |
Wed, 16 Aug 2000 20:59:00 -0500 |
To: |
bobmin(at)nidlink.com, hwg-languages(at)mail.hwg.org |
References: |
|
|
todo: View
Thread,
Original
|
|
At 04:41 PM 8/16/00 -0700, bobmin(at)nidlink.com wrote:
> Adding the line;
>
>require "spiderlib.pl";
>
> To the top of the file with the other required auxilliary files causes
>an error 500 with an error message of;
>
>spiderlib.pl did not return a true value at ss_promain_beta.pl line 17.
Basically, make sure that any file you will be 'require'ing or 'use'ing end
in a line containing '1;'. That way, the file will be guaranteed to return
a true value. (The return value of the last command executed in the file
is returned in a 'require' or 'use' call.)
As an aside, if you are going to the trouble of putting the code into a
separate file (and I wholeheartedly agree with this approach), you might
want to think about reading the docs on modules, and using a .pm file
instead of a .pl file.
-JEV
--
John Erjavec V ## spammers-will-be-reported(at)jevonline.com
## http://www.jevonline.com/jev/index.html
"I'll say it again for the logic impaired." --Larry Wall
HWG: hwg-languages mailing list archives,
maintained by Webmasters @ IWA