logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Module::Optimize - Perl Module Optimization

Authors

       •   Ingy döt Net <ingy@cpan.org>

       •   Audrey Tang <audreyt@audreyt.org>

Description

       This module provides a system for writing modules that compile other Perl modules.

       Modules that use these compilation modules get compiled into some altered form the first time they are
       run. The result is cached into ".pmc" files.

       Perl has native support for ".pmc" files. It always checks for them, before loading a ".pm" file.

       You get the following benefits:

Name

       Module::Optimize - Perl Module Optimization

See Also

       Module::Compile

Synopsis

           package Foo;
           use Module::Optimize -base;

           sub pmc_optimize {
               my ($self, $source) = @_;
               # Convert perl5 $source into semantically equivalent $compiled_output
               return $compiled_output;
           }

       In "Bar.pm":

           package Bar;

           use Foo;

       or lexically:

           package Bar;

           {
               use Foo;
               ...
           }

       To compile "Bar.pm" into "Bar.pmc":

           perl -c Bar.pm

See Also