On Mon, 10 Jul 2006, Don Armstrong wrote: > Not really, because it requires hard coding the configuration file > location and loading that first; far better to use PERL_LIB or similar > to set it. [Or just install into the appropriate location if you're > using suexec or something.]
How is it done on spohr ? I'm wondering how to change PERL_LIB for a CGI started by apache. Do you use a site-wide environment variable ? > Couple comments really quick so I remember when I or someone else > applies this: I'll provide an updated patch once I have all the answers I need. > === added file 'cgi/soap.cgi' > --- /dev/null > +++ cgi/soap.cgi > @@ -0,0 +1,18 @@ > +#!/usr/bin/perl -wT > + > +package debbugs; > + > +use SOAP::Transport::HTTP; > +use vars qw($gSoapDir $gLibDir); > + > +BEGIN { > + require '/etc/debbugs/config'; > + if (defined($gLibDir) && $gLibDir) { > + push @INC, $gLibDir; > + } > +} > > This creates a dependency on the config file which isn't needed; same > with everything below.. The "require /etc/debbugs/config" is present in all other CGI scripts. I don't see that as a problem. The @INC handling could be removed however. The require is needed for $gSoapDir mainly... see below (and also for $gSpoolDir in the Usertag case). > +SOAP::Transport::HTTP::CGI > + -> dispatch_to($gSoapDir, 'Usertag') > > making this just Debbugs::SOAP::Usertag; is better... however I kind > of think that this will have to become Debbugs::SOAP eventually, with > the SOAP module use'ing all the appropriate sub modules. Well, this function has some special security measures making impossible to access modules in @INC if you don't harcode the directory where they are used from. Thus $gSoapDir ... It will be difficult to avoid this AFAIK. If you add new functionalities in new modules, you just have to add them in the dispatch_to call: ex: -> dispatch_to($gSoapDir, 'Usertag', 'Index', 'ComplexQueries') Cheers, -- Raphaël Hertzog Premier livre français sur Debian GNU/Linux : http://www.ouaza.com/livre/admin-debian/