This is useful when you are sharing a config file between
a number of hosts, of which not all are the same architecture.
sub load_config_files {
require $conf_file || die "Can't load $conf_file: $!";
+
+ my ($sysname) = (uname)[0];
+ $sysname =~ s/[^A-Za-z0-9]/_/g; # Eat any nasty characters
+
+ if( -f "$conf_file.$sysname" ) {
+ require "$conf_file.$sysname" || die "Can't load $conf_file.$sysname: $!";
+ }
+
if( -f "$conf_file.$HOST" ) {
require "$conf_file.$HOST" || die "Can't load $conf_file.$HOST: $!";
} else {
sub load_config_files {
require $conf_file || die "Can't load $conf_file: $!";
+
+ my ($sysname) = (uname)[0];
+ $sysname =~ s/[^A-Za-z0-9]/_/g; # Eat any nasty characters
+
+ if( -f "$conf_file.$sysname" ) {
+ require "$conf_file.$sysname" || die "Can't load $conf_file.$sysname: $! ";
+ }
+
if( -f "$conf_file.$HOST" ) {
require "$conf_file.$HOST" || die "Can't load $conf_file.$HOST: $!";
} else {
sub load_config_files {
my( $evalme, $inhosts );
+ my ($sysname) = (uname)[0];
+ $sysname =~ s/[^A-Za-z0-9]/_/g; # Eat any nasty characters
+
+ if( -f "$conf_file.$sysname" ) {
+ require "$conf_file.$sysname" || die "Can't load $conf_file.$sysname: $!";
+ }
+
require $conf_file || die "Can't load $conf_file: $!";
if( -f "$conf_file.$HOST" ) {
require "$conf_file.$HOST" || die "Can't load $conf_file.$HOST: $!";