1Module::Optimize(3) User Contributed Perl Documentation Module::Optimize(3)
2
3
4
6 Module::Optimize - Perl Module Optimization
7
9 package Foo;
10 use Module::Optimize -base;
11
12 sub pmc_optimize {
13 my ($self, $source) = @_;
14 # Convert perl5 $source into semantically equivalent $compiled_output
15 return $compiled_output;
16 }
17
18 In "Bar.pm":
19
20 package Bar;
21
22 use Foo;
23
24 or lexically:
25
26 package Bar;
27
28 {
29 use Foo;
30 ...
31 }
32
33 To compile "Bar.pm" into "Bar.pmc":
34
35 perl -c Bar.pm
36
38 This module provides a system for writing modules that compile other
39 Perl modules.
40
41 Modules that use these compilation modules get compiled into some
42 altered form the first time they are run. The result is cached into
43 ".pmc" files.
44
45 Perl has native support for ".pmc" files. It always checks for them,
46 before loading a ".pm" file.
47
48 You get the following benefits:
49
51 Module::Compile
52
54 · Ingy döt Net <ingy@cpan.org>
55
56 · Audrey Tang <audreyt@audreyt.org>
57
59 Copyright 2006-2019. Ingy döt Net.
60
61 This program is free software; you can redistribute it and/or modify it
62 under the same terms as Perl itself.
63
64 See <http://www.perl.com/perl/misc/Artistic.html>
65
66
67
68perl v5.32.0 2020-07-28 Module::Optimize(3)