perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Boysenberry Payne <>
Subject Wondering if using a <perl> section is the best approach for dynamic server configuration
Date Tue, 12 Jan 2010 08:16:10 GMT
I'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;
	use File::Spec::Unix;
	use Cwd;
	my $volume;
	$dir_reg					= qr{(?xms) \A( / ( /|.+ ) )\z};
	($volume, $conf_dir, $file)	= File::Spec::Unix->splitpath( __FILE__ );
	($local_rt_dir)			= Cwd::abs_path(($conf_dir . "../../")) =~ m{$dir_reg};
	unshift(@INC, (($local_rt_dir . "/PerlModules") =~ m{$dir_reg}));
my ($startup_dir) = ($conf_dir . "perl_startup") =~ m{$dir_reg};
push @PerlConfig, "PerlConfigRequire		$startup_dir/";
push @PerlConfig, "PerlPostConfigRequire	$startup_dir/";

Basically I use this for addressing my 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
View raw message