NAME

Module::MagicUse - Automagically include files by invoking their constructor

SYNOPSIS

use Module::MagicUse;

my $q = CGI->new();
my $p = new XML::Parser();

DESCRIPTION

If you use a constructor this module will try to include the calling module. For example

my $q = CGI->new();

will include the CGI module. The pattern of a construtor is this

new Module

or

Module->constructor

So it will explicitly look for a new before what looks like a module name if you're using indirect method syntax. However with direct method invocation syntax you just need what looks like a module pointing to what looks like a method name. This should be fairly reliable since modules and methods can be mapped pretty simply to regexes.

REQUIREMENTS

Regexp::Common Text::Balanced

BUGS

x

Doesn't auto-magically include itself.

x

The module-grabbing probably isn't 100% accurate, and could be improved

THANKS

Damian Conway for Filter::Simple, and brian_d_foy for the inspiration for this module (see. http://use.perl.org/~brian_d_foy/journal/8361).

AUTHOR

Dan Brook <broquaint@hotmail.com>

SEE ALSO

perl, import