run. Since version 5.005, Perl has shipped with a module
capable of inspecting the optimized parse tree (C<B>), and this has
been used to write many useful utilities, including a module that lets
-you turn your Perl into C source code that can be compiled into an
+you turn your Perl into C source code that can be compiled into a
native executable.
The C<B> module provides access to the parse tree, and other modules
rename $was, $_ unless $was eq $_;
}
-(this is the I<rename> program that comes in the I<eg/> directory
-of the Perl source distribution).
-
The decompiler has several options for the code it generates. For
instance, you can set the size of each indent from 4 (as above) to
2 with:
this functionality.
To turn a Perl program into executable byte code, you can use C<perlcc>
-with the C<-b> switch:
+with the C<-B> switch:
- perlcc -b myperlprogram.pl
+ perlcc -B myperlprogram.pl
The byte code is machine independent, so once you have a compiled
module or program, it is as portable as Perl source (assuming that
the Perl interpreter library, to allow for eval(), C<s///e>,
C<require>, etc.
-The C<perlcc> tool generates such executables when using the -opt
+The C<perlcc> tool generates such executables when using the -O
switch. To compile a Perl program (ending in C<.pl>
or C<.p>):
- perlcc -opt myperlprogram.pl
+ perlcc -O myperlprogram.pl
To produce a shared library from a Perl module (ending in C<.pm>):
- perlcc -opt Myperlmodule.pm
+ perlcc -O Myperlmodule.pm
For more information, see L<perlcc> and L<B::CC>.
+=head1 Module List for the Compiler Suite
+
=over 4
=item B
interpreted programs. See L</"The Optimized C Back End"> for
details about usage.
+=item B::Concise
+
+This module prints a concise (but complete) version of the Perl parse
+tree. Its output is more customizable than the one of B::Terse or
+B::Debug (and it can emulate them). This module useful for people who
+are writing their own back end, or who are learning about the Perl
+internals. It's not useful to the average programmer.
+
=item B::Debug
This module dumps the Perl parse tree in verbose detail to STDOUT.