From 3171058c59a2620f0d19d84aba68ce51e4fa470d Mon Sep 17 00:00:00 2001 From: dms Date: Wed, 10 Jan 2001 14:54:03 +0000 Subject: [PATCH] - AUTOLOAD to ignore __ - use eval on 'require'. git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@233 c11ca15a-4712-0410-83d8-924469b57eb5 --- src/modules.pl | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/modules.pl b/src/modules.pl index 7bee1c5..3c52c0f 100644 --- a/src/modules.pl +++ b/src/modules.pl @@ -60,8 +60,13 @@ sub loadCoreModules { 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 ($@) { + &WARN("lCM => $@"); + } + $moduleAge{$mod} = (stat $mod)[9]; &showProc(" ($file)") if (&IsParam("DEBUG")); } @@ -121,7 +126,11 @@ sub loadFactoidsModules { 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: $@"); + } + $moduleAge{$mod} = (stat $mod)[9]; &showProc(" ($file)") if (&IsParam("DEBUG")); } @@ -331,6 +340,8 @@ if ($@) { &showProc(" (Time::HiRes)"); sub AUTOLOAD { + return if ($AUTOLOAD =~ /__/); # internal. + &ERROR("UNKNOWN FUNCTION CALLED: $AUTOLOAD"); foreach (@_) { next unless (defined $_); -- 2.39.5