From: Jamie C. <jca...@we...> - 2005-03-31 00:27:08
|
On Thu, 2005-03-31 at 01:48, Bruce M Potter wrote: > I've developed a webmin module that has some of the cgi scripts in > subdirectories, just to keep things organized. But somewhere between > webmin 1.130 and 1.190 it stopped working because when web-lib.pl > loads web-lib-funcs.pl it assumes it is either in the same dir or 1 > level up. In my subdirs, it is actually 2 levels up, so none of the > functions get defined. I have a temporary work-around, but I wanted > to bring this to your attention so you could hopefully fix it and let > me know if there are any other assumptions in the code about a single > directory level. Thanks! > > Thanks for a great tool! Probably the best way to write a module that uses subdirectories is to put code into your CGI script like this : #!/usr/local/bin/perl chdir(".."); require './webmin-lib.pl'; &header("smeg", ""); print "module = $module_name<br>\n"; print "module root = $module_root_directory<br>\n"; print "module config = $module_config_directory<br>\n"; &footer(); The initial chdir will solve any problems related to finding files in the expected directories just fine. - Jamie |