-$In{action} ||= "hostInfo" if ( defined($In{host}) );
-$In{action} = "generalInfo" if ( !defined($ActionDispatch{$In{action}}) );
-my $action = $ActionDispatch{$In{action}};
+if ( !defined($ActionDispatch{$In{action}}) ) {
+ $In{action} = defined($In{host}) ? "hostInfo" : "generalInfo";
+}
+my $action = $ActionDispatch{$In{action}};
+
+#
+# For some reason under mod_perl, the use lib above is unreliable,
+# and sometimes the module below cannot be found. Explicitly push
+# the directory onto INC if it is missing. This is an ugly hack;
+# need to figure out what's really going on...
+#
+my $installDir = '/usr/local/BackupPC/lib';
+push(@INC, $installDir) if ( !grep($_ eq $installDir, @INC) );
+
+#
+# Load the relevant action script and run it
+#