Wondering if using a <perl> section is the best approach for dynamic server configuration
am 12.01.2010 09:16:10 von Boysenberry PayneI'm trying to do some server configuration where I use the same code on =
several different servers and the code is located in different places =
for each server.
I want to make sure this code is the best way to accomplish this or =
inquire if anyone knows if there is a better way.
#!/usr/bin/perl -wT
my ($conf_dir, $file, $local_rt_dir);
my $dir_reg;
BEGIN
{
use File::Spec::Unix;
use Cwd;
=09
my $volume;
=09
$dir_reg =3D qr{(?xms) =
\A( / ( /|.+ ) )\z};
($volume, $conf_dir, $file) =3D File::Spec::Unix->splitpath( =
__FILE__ );
($local_rt_dir) =3D Cwd::abs_path(($conf_dir . =
"../../")) =3D~ m{$dir_reg};
=09
unshift(@INC, (($local_rt_dir . "/PerlModules") =3D~ =
m{$dir_reg}));
}
my ($startup_dir) =3D ($conf_dir . "perl_startup") =3D~ m{$dir_reg};
push @PerlConfig, "PerlConfigRequire =
$startup_dir/early_server_config.pl";
push @PerlConfig, "PerlPostConfigRequire =
$startup_dir/perl_mods.pl";
__END__
Basically I use this for addressing my startup.pl type files and =
altering my @LIB as early as possible.
Is this a less than desirable approach for any reason, and is there a =
better one?
Thank you,
Boysenberry Payne=