in reply to Re: Re: Re: CGI script organisation
in thread CGI script organisation

Yeah, this is one way to do it. I can let the configure script process to to replace the paths with their actual values. It's ugly, but it'll do. Thanks!
  • Comment on Re: Re: Re: Re: CGI script organisation

Replies are listed 'Best First'.
Re^5: CGI script organisation
by Aristotle (Chancellor) on Jan 27, 2002 at 21:16 UTC
    Yes, ugly indeed - have the CGI read another file which contains the configuration instead. I usually require a config.cgi located in the same directory as the script and looks something like
    #!perl -w use constant (OPTION1 => 'value1'); use constant (OPTION2 => 'value2'); use constant (OPTION3 => 'value3'); 1;
    Note that care should be taken with the server configuration in that case, and the file should be executable. On a properly configured server, calling this file on the URL will then result in a 500 server error.

    Makeshifts last the longest.

Re: Re: Re: Re: Re: CGI script organisation
by IlyaM (Parson) on Jan 27, 2002 at 22:07 UTC
    Another aproach is setting module search path using enviroment variable PERL5LIB. This way you don't need use lib qw(/some/where) in your code. Your users (or your installation script) should put SetEnv PERL5LIB /some/where in Apache config instead of it.

    See perlrun for information about enviroment variables used by perl.

    Ilya Martynov (