### MODULES.
%myModules = (
"countdown" => "Countdown.pl",
- "allowDNS" => "DNS.pl",
"debian" => "Debian.pl",
"debianExtra" => "DebianExtra.pl",
"dict" => "Dict.pl",
"wingate" => "Wingate.pl",
"insult" => "insult.pl",
"nickometer" => "nickometer.pl",
+ "babelfish" => "babel.pl",
);
@myModulesLoadNow = ('topic', 'uptime',);
@myModulesReloadNot = ('IRC/Irc.pl','IRC/Schedulers.pl');
next unless $file =~ /\.pl$/;
next unless $file =~ /^[A-Z]/;
my $mod = "$bot_src_dir/$file";
+
### TODO: use eval and exit gracefully?
- require $mod;
+ eval "require \"$mod\"";
+ if ($@) {
+ &ERROR("lCM => $@");
+ &shutdown();
+ exit 1;
+ }
+
$moduleAge{$mod} = (stat $mod)[9];
&showProc(" ($file)") if (&IsParam("DEBUG"));
}
next unless $file =~ /^[A-Z]/;
my $mod = "$bot_src_dir/Factoids/$file";
### TODO: use eval and exit gracefully?
- require $mod;
+ eval "require \"$mod\"";
+ if ($@) {
+ &WARN("lFM: $@");
+ exit 1;
+ }
+
$moduleAge{$mod} = (stat $mod)[9];
&showProc(" ($file)") if (&IsParam("DEBUG"));
}
exit 1;
}
&showProc(" (Net::IRC)");
+
} else {
&status("IRC support DISABLED.");
return;
&status("Loading MyModules...");
foreach (@myModulesLoadNow) {
$total++;
+ if (!defined $_) {
+ &WARN("mMLN: null element.");
+ next;
+ }
+
+ if (!&IsParam($_) and !&IsChanConf($_)) {
+ if (exists $myModules{$_}) {
+ &DEBUG("myModule: $myModules{$_} (1) not loaded.");
+ } else {
+ &DEBUG("myModule: $_ (2) not loaded.");
+ }
- if (!exists $param{$_}) {
- &DEBUG("myModule: $myModules{$_} not loaded.");
next;
}
+
&loadMyModule($myModules{$_});
$loaded++;
}
eval "require \"$modulefile\"";
if ($@) {
&ERROR("cannot load my module: $modulebase");
- if ($bot_pid == $$) { # parent.
- &shutdown() if (defined $shm and defined $dbh);
- } else { # child.
+ if ($bot_pid != $$) { # child.
&DEBUG("b4 delfork 2");
&delForked($modulebase);
exit 1;
}
}
-### this chews 3megs on potato, 300 kB on slink.
-$no_syscall = 0;
-###eval "require 'sys/syscall.ph'";
-#if ($@) {
-# &WARN("sys/syscall.ph has not been installed//generated. gettimeofday
-#will use time() instead");
- $no_syscall = 1;
-#}
-#&showProc(" (syscall)");
+$no_timehires = 0;
+eval "use Time::HiRes qw(gettimeofday tv_interval)";
+if ($@) {
+ &WARN("No Time::HiRes?");
+ $no_timehires = 1;
+}
+&showProc(" (Time::HiRes)");
sub AUTOLOAD {
+ return if ($AUTOLOAD =~ /__/); # internal.
+
&ERROR("UNKNOWN FUNCTION CALLED: $AUTOLOAD");
foreach (@_) {
+ next unless (defined $_);
&status(" => $_");
}
}