Skip to content

Commit

Permalink
made Mojo::Loader synopsis more foolproof
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 25, 2011
1 parent b8a7c89 commit 8c56e7d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/Mojo/Loader.pm
Expand Up @@ -78,9 +78,14 @@ Mojo::Loader - Loader
use Mojo::Loader;
# Find modules in a namespace
my $loader = Mojo::Loader->new;
my $modules = $loader->search('Some::Namespace');
$loader->load($modules->[0]);
for my $module (@{$loader->search('Some::Namespace')}) {
# And load them safely
my $e = $loader->load($module);
warn qq/Loading "$module" failed: $e/ if ref $e;
}
=head1 DESCRIPTION
Expand Down

0 comments on commit 8c56e7d

Please sign in to comment.