sub loadDBModules {
&status("Loading DB modules...");
- $moduleAge{"$bot_src_dir/modules.pl"} = time();
+ my $f = "$bot_src_dir/modules.pl";
+ $moduleAge{$f} = (stat $f)[9];
if ($param{'DBType'} =~ /^mysql$/i) {
eval "use DBI";
&showProc(" (DBI // mysql)");
&status(" using MySQL support.");
- require "$bot_src_dir/db_sql.pl";
- require "$bot_src_dir/db_mysql.pl";
- $moduleAge{"$bot_src_dir/db_mysql.pl"} = time();
+ $f = "$bot_src_dir/db_mysql.pl";
+ require $f;
+ $moduleAge{$f} = (stat $f)[9];
} elsif ($param{'DBType'} =~ /^pgsql$/i) {
- eval "use Pg";
+# eval "use Pg";
+ eval "use DBI";
if ($@) {
&ERROR("libpgperl is not installed!");
exit 1;
}
- &showProc(" (Pg // postgreSQLl)");
+ &showProc(" (pgsql)");
- &status(" using PostgreSQL support.");
- require "$bot_src_dir/db_sql.pl";
+ &status(" using pgsql support.");
require "$bot_src_dir/db_pgsql.pl";
} elsif ($param{'DBType'} =~ /^dbm$/i) {
return if ($age == $moduleAge{$file});
if ($age < $moduleAge{$file}) {
- &WARN("rM: we're not gonna downgrade the file. use 'touch'.");
+ &WARN("rM: we're not gonna downgrade '$file'; use touch.");
+ &DEBUG("age => $age");
+ &DEBUG("mA{$file} => $moduleAge{$file}");
return;
}
&showProc(" (Time::HiRes)");
sub AUTOLOAD {
+ if (!defined $AUTOLOAD and defined $::AUTOLOAD) {
+ &DEBUG("AUTOLOAD: hrm.. ::AUTOLOAD defined!");
+ }
+ return unless (defined $AUTOLOAD);
return if ($AUTOLOAD =~ /__/); # internal.
my $str = join(', ', @_);
my($dir) = @_;
if (!opendir(DIR, $dir)) {
- &ERROR("cannot open source directory $dir: $!");
+ &ERROR("Cannot open source directory ($dir): $!");
exit 1;
}