Using DynaLoader

Use DynaLoader like this:

package Module;
require DynaLoader;
@ISA = qw(... DynaLoader ...);

bootstrap Module;

The bootstrap method calls your module’s bootstrap routine directly if the module is statically linked into Perl. Otherwise, the module inherits the bootstrap method from DynaLoader, which loads in your module and calls its bootstrap method.

Get Perl in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.