in reply to Running Perl scripts from a single CGI-BIN, on a multiple-virtual hosting server

I've found myself in a very similar situation to your own, and headed down the same path. In the end, I decided that coming up with a global configuration file that each globally accessible script could pull from was just not the solution I was looking for. After all, some scripts just needed a small bit of tweaking to make them usable by all virtual hosts on my machine. Instead, I took the approach of tweaking each script such that it would be globally usable without further editing by end users, and hopefully in a manner that would allow the script to avoid further editing as new domains were placed on the machine.

My small case in point is something that I think you referred to in your post, a formmail script.

The script relies on checks against the $ENV{'HTTP_REFERER'} variable and provides an array that can hold the various domains on your machine. To make the script globally accessible without having to update it per domain, I rewrote the array to pull all local domains from already existing file like /etc/mail/sendmail.cw or perhaps your zone files from dns.

Regardless of how you do it, chances are that each script just needs a small rewrite to bring it up to speed as globally accessible. I am far from being a monk with major perl-fu power, but it certainly fit my needs and took very little time to do.

my @referers; open(FH, "/etc/mail/sendmail.cw") or die "Cant open $i! : $!\n"; while(<FH>) { chomp; my $www = "www.$_"; push(@referers, $_); push(@referers, $www); } close(FH); }

humbly -c