Mojo::Loader - Loader
use Mojo::Loader; # Find modules in a namespace my $loader = Mojo::Loader->new; 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; }
Mojo::Loader is a class loader and plugin framework.
Mojo::Loader inherits all methods from Mojo::Base and implements the following new ones.
load
my $e = $loader->load('Foo::Bar');
Load a class and catch exceptions. Note that classes are checked for a new method to see if they are already loaded.
new
if (my $e = $loader->load('Foo::Bar')) { die "Exception: $e" if ref $e; }
search
my $modules = $loader->search('MyApp::Namespace');
Search for modules in a namespace non-recursively.
Mojolicious, Mojolicious::Guides, http://mojolicio.us.
To install Mojolicious, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious
CPAN shell
perl -MCPAN -e shell install Mojolicious
For more information on module installation, please visit the detailed CPAN module installation guide.