home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


8.12 B::CC

The CC backend for the Perl compiler. Generates optimized C source code that corresponds to your program's flow. The initial version included in Perl 5.005 actually includes few optimizations, but this will change. Programs compiled with this backend may both start up and execute slightly faster. Invoke as:

perl -MO=C[,
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:

l

Outputs the filename and line number of each original line of Perl code as it is processed.

O

Outputs each OP as it is compiled.

p

Outputs the contents of the shadow pad of lexicals as it is loaded for each sub or for the main program.

q

Outputs the name of each fake PP function in the queue as it's about to be processed.

r

Writes debugging output to STDERR instead of as comments in the C output.

s

Outputs the contents of the shadow stack at each OP.

t

Outputs timing information of the stages of compilation.

-fopt

Forces individual optimizations on or off. Possible values of opt are:

freetmps-each-bblock

Runs FREETMPS at the end of each basic block instead of at the end of each statement. freetmps-each-loop and freetmps-each-bblock are mutually exclusive.

freetmps-each-loop

Runs FREETMPS at the end of each loop instead of at the end of each statement. freetmps-each-loop and freetmps-each-bblock are mutually exclusive.

omit-taint

Doesn't generate code for handling Perl's tainting mechanism.

-mModulename

Generates source for an XSUB module instead of for an executable.

-ofilename

Sends output to filename instead of to STDOUT.

-O[ n ]

Sets optimization level, where n is an integer. n defaults to 1. Currently, -O1 sets -ffreetmps-each-bblock , and -O2 sets -ffreetmps-each-loop .

-uPackname

Forces apparently unused subroutines from package Packname to be compiled, permitting programs to use eval "foo()" even if subroutine foo isn't seen to be used at compile time. You can specify multiple -u options.

-v

Compiles verbosely.