[rt-devel] Mail::Field lowercasing submodule names?
jesse
jesse at fsck.com
Sun Jun 18 06:10:50 EDT 2000
So, for some reason I don't quite understand, my application, which uses
MIME::Tools, which in turn uses Mail::Field dies after being unable
to find Mail/field/addrlist.pm. What it really seems to want is
Mail::Field::AddrList. (The same is actually true of Date.pm, too)
The culprit code appears to be the line "my $p = lc $1;" in _require_dir.
I presume there's a good reason (msdos filesystems?) for this that I'm just
missing. If you have any suggestions, I'd greatly appreciate them.
Thanks,
Jesse Vincent
jesse at fsck.com
sub _require_dir
{
my($pkg,$dir,$dir_sep) = @_;
if(opendir(DIR,$dir))
{
my @inc = ();
my $f;
foreach $f (readdir(DIR))
{
next
unless $f =~ /^([\w\-]+)/;
my $p = lc $1;
my $n = $dir . $dir_sep . $p;
if(-d $n )
{
_require_dir( $pkg . "::" . $f, $n, $dir_sep);
}
else
{
$p =~ s/-/_/go;
eval "require ${pkg}::$p"
}
}
closedir(DIR);
}
More information about the Rt-devel
mailing list