I was wondering something about DBIx::AnyDBD's implementation:

Since eval "require $class" will automatically do a substitution 
of :: for / and then append .pm why does AnyDBD.pm always opt for 
specifying $filename.pm instead of specifying $module_name and 
letting Perl do the conversion?

Needless to say, had you opted for $module_name requires over 
$filename.pm requires, then
eval { require $filename } would be rewritten eval "require 
$module_name"



($dir = $self->{package}) =~ s/::/\//g;
     load_module("$dir/Default.pm") or die "Cannot find Default.pm 
module!";

sub load_module {
     my $module = shift;

     eval {
         require $module;
     };
     if ($@) {
         if ($@ =~ /^Can't locate $module in \@INC/) {
             undef $@;
             return 0;
         } else {
             die $@;
         }
     }
     return 1;
}

Reply via email to