use URI;
use Class::Inspector;
use Carp qw/croak/;
+use Cwd;
=head1 NAME
# find the @INC entry in which $file was found
(my $path = $inc_entry) =~ s/$file$//;
+ $path ||= cwd() if !defined $path || !length $path;
my $home = dir($path)->absolute->cleanup;
# pop off /lib and /blib if they're there
# clean up relative path:
# MyApp/script/.. -> MyApp
- my ($lastdir) = $home->dir_list( -1, 1 );
- if ( $lastdir eq '..' ) {
+ my $dir;
+ my @dir_list = $home->dir_list();
+ while (($dir = pop(@dir_list)) && $dir eq '..') {
$home = dir($home)->parent->parent;
}
my $error;
{
local $@;
- eval "require $class;";
+ my $file = $class . '.pm';
+ $file =~ s{::}{/}g;
+ eval { CORE::require($file) };
$error = $@;
}
return;
}
-=head1 AUTHOR
+=head1 AUTHORS
-Sebastian Riedel, C<sri@cpan.org>
-Yuval Kogman, C<nothingmuch@woobling.org>
+Catalyst Contributors, see Catalyst.pm
=head1 COPYRIGHT