On 11/28/05, Shawn Hinchy <[EMAIL PROTECTED]> wrote:
> Sorry for the simple question, but I programmed perl before I ever tried CGI.
> Anyway, I want to have a few utility-type functions in a separate file and
> 'include' them in my cgi script.  Whenever I do, I get a server configuration
> error when I call the script.  Should I be including .pl or .cgi files?  Can I
> have external functions like this?

Hi Shawn,

It always helps to show a little bit of code.  To load a bunch of
functions that you have in a separate file, you can just use the
'require' function.

require 'library.pl';

-or-

require 'library.pm';

-or-

require '/home/shawn/perl/lib/library.pl';

-or-

use lib qw(/home/shawn/perl/lib); # add to the library search path
require 'library.pl';


Also, I am guessing that you think this is a mailing list for generic
CGI related perl questions.  In fact, this mailing list is
specifically for discussing the CGI::Application module which can make
life a lot easier for you when building CGI programs in perl.  Have a
look if you are just starting out with CGI scripts.

For generic perl type questions, you might try out
http://perlmonks.org/.  There are lots of competent perl programmers
there, but make sure to search the archives first.

Cheers and good luck,

Cees

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to