require

Greg Minter gminter at hevanet.com
Wed Aug 15 16:28:25 CDT 2001


Kari Chisholm wrote:
> 
> Howdy all--
> 
> This may be a moron question, but I can't seem to get it to work.
> 
> I've got two CGI's
> 
>         http://www.clientone.com/coolapp.cgi
>         http://www.clienttwo.com/coolapp.cgi
> 
> that really live on my server here
> 
>         /www/karic/clientone/coolapp.cgi
>         /www/karic/clienttwo/coolapp.cgi
> 
> I want each of them to read in subroutines and settings from a single place
> 
>         /www/karic/mystuff/global.cgi

  The approach I use is to place everything in subroutines in a perl
module file. This is like a ".cgi" or ".pl" file, but has a ".pm"
extension and ends with a "1;" on the last line.

         /www/karic/mystuff/global.pm

  Then use the "use lib" directive to identify the directory.

        use lib '/www/karic/mystuff';
        use global;

  I don't think that variable settings can be seen across files. They
must
be read from subroutines.

  I hope this helps.

  -Greg
TIMTOWTDI



More information about the Pdx-pm-list mailing list