B::Bytecode

The bytecode backend for the Perl compiler. Takes Perl source code and generates platform-independent bytecode that can be run with the byteperl executable or can be loaded via the byteload_fh function in the B module. Compiling with the Bytecode backend won’t speed up execution of your program, but it may improve start-up time. Invoke as:

perl -MO=Bytecode[,options] program

where program is the name of the Perl script to compile. Any non-option arguments are treated as the names of objects to be saved; the main program is assumed if there are no extra arguments. Possible options are:

--

Forces end of options.

-Dopts

Debug options, which can be either concatenated or specified separately. Possible options are:

-fopt

Forces individual optimizations on or off. Preceding an optimization with no- turns that option off (e.g., no-compress-nullops). Possible values of opt are:

-m

Compiles as a module rather than as a standalone program.

-ofilename

Sends output to filename instead of STDOUT.

-O[n]

Sets the optimization level to n, where n is an integer. n defaults to 1. -O1 sets -fcompress-nullops -fomit-sequence-numbers, and -O6 adds -fstrip-syntax-tree.

-S

Outputs bytecode assembler source instead of assembling it into bytecode.

Get Perl in a Nutshell 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.