Subject: | fails to work with coderefs in @INC |
Date: | Tue, 21 Jul 2009 18:08:36 +0100 |
To: | bug-Module-Load-Conditional [...] rt.cpan.org |
From: | Nick Williams <Nick.Williams [...] morganstanley.com> |
Conditional has code to look for support coderefs within @INC, however it
doesn't work. The code in Conditional.pm looks like:
} elsif (UNIVERSAL::can($dir, 'INC')) {
($fh) = $dir->INC->($dir, $file);
}
This looks like some strange hybrid between a function call and a method
call. Oddly, the INC method gets invoked, but with only one argument ($self,
from the $dir in $dir->INC) and the supplied arg list ($dir, $file) is
dropped.
It works if you use the more intuitive syntax:
} elsif (UNIVERSAL::can($dir, 'INC')) {
($fh) = $dir->INC ($file);
}
Cheers,
Nick.