]> git.donarmstrong.com Git - infobot.git/commitdiff
finally nailed this "random" bug noticed by asuffield.
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sun, 1 Apr 2001 15:16:02 +0000 (15:16 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sun, 1 Apr 2001 15:16:02 +0000 (15:16 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@425 c11ca15a-4712-0410-83d8-924469b57eb5

src/modules.pl

index 7050f233dfed49be48b460f2fdb9cf3f9ace8174..d06ec19ce7c960a08843a112aed99d998c0bd68f 100644 (file)
@@ -61,10 +61,17 @@ sub loadCoreModules {
 
     &status("Loading CORE modules...");
 
+    my @mods;
     while (defined(my $file = readdir DIR)) {
        next unless $file =~ /\.pl$/;
        next unless $file =~ /^[A-Z]/;
-       my $mod = "$bot_src_dir/$file";
+       push(@mods, $file);
+    }
+    closedir DIR;
+    &DEBUG("mods: ".scalar(@mods)." to be loaded...");
+
+    foreach (sort @mods) {
+       my $mod = "$bot_src_dir/$_";
 
        ### TODO: use eval and exit gracefully?
        eval "require \"$mod\"";
@@ -75,9 +82,8 @@ sub loadCoreModules {
        }
 
        $moduleAge{$mod} = (stat $mod)[9];
-       &showProc(" ($file)") if (&IsParam("DEBUG"));
+       &showProc(" ($_)") if (&IsParam("DEBUG"));
     }
-    closedir DIR;
 }
 
 sub loadDBModules {