Masahiro Funakoshi > Module-Recursive-Require-0.04 > Module::Recursive::Require

Download:
Module-Recursive-Require-0.04.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.04   Source  

NAME ^

Module::Recursive::Require - This class require module recursively.

DESCRIPTION ^

 # ************************************** before
 use MyApp::Foo;
 use MyApp::Foo::CGI;
 use MyApp::Foo::Mail;
 use MyApp::Foo::Mail::Send;
 
 # use use use use use !!
 
 use MyApp::Foo::Hoge::Orz;

 # ************************************** after
 use Module::Recursive::Require;
 use MyApp::Foo;

 my @required_packages
    = Module::Recursive::Require->new()->require_by('MyApp::Foo'); 

SYNOPSIS ^

 use Module::Recursive::Require;
 
 my $r = Module::Recursive::Require->new();
 $r->first_loads(
                    qw/
                          MyApp::Foo::Boo
                      /
                );                          # * It loads first.
 $r->add_filter(qr/^Hoge/);                 # * Don't loaded  qr/^Hoge/
 $r->add_filter(qr/Base.pm$/);              # * Don't loaded  qr/Base.pm$/
 
 my @packages = $r->require_of('MyApp::Foo');

 # * or

 my $packages_array_ref
     = $r->require_of('MyApp::Foo');

METHOD ^

new( \%args )

 %args = (
    path       => '/var/www/my/lib', # * default $INC[0]
    extensions => 'pm'             , # * default "pm" and "pl"
 );

first_loads( @package_names );

add_filter(qr/regexp/)

require_of( 'MyApp::Foo' );

require_by( 'MyApp::Foo' );

Deprecated. For backwards compatibility only.

SEE ALSO ^

UNIVERSAL::require

AUTHOR ^

Masahiro Funakoshi <masap@cpan.org>

syntax highlighting: