From: dms Date: Sun, 1 Apr 2001 15:16:02 +0000 (+0000) Subject: finally nailed this "random" bug noticed by asuffield. X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=838bf233b41d4fd5daa30c8e4b2b9ae447a45cf2;p=infobot.git finally nailed this "random" bug noticed by asuffield. git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@425 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/src/modules.pl b/src/modules.pl index 7050f23..d06ec19 100644 --- a/src/modules.pl +++ b/src/modules.pl @@ -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 {