Mrequire - require on Perl extensions at run time
require Mrequire; my $class = ('Foo::Bar', 'Bar::Baz')[int(rand + .5)]; Mrequire::mrequire($class); &Mrequire::new($class, $arg1, $arg2, ...); use Mrequire qw(mrequire); mrequire(...)
Mrequire can be used to dynamically load Perl extensions at run time. This becomes necessary if the decision of what kind of module you want to use (or is available at all) is made at run time.
In addition you can call constructor-like functions (which assume the package name as their first argument, see pertoot(1) for details) of dynamically loaded modules via Mrequire.
$class. If a respective library file cannot be loaded the process dies.
- &Mrequire::constructor($class, $arg1, $arg2, ...)
constructorin package $class. It is assumed that
constructorexpects the package name as a first argument.
Yes. Please let me know!
Norbert Gövert <firstname.lastname@example.org>
Copyright (c) 2003 Norbert Gövert. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.