Perl in a Nutshell

Perl in a NutshellSearch this book
Previous: 8.13 B::DebugChapter 8
Standard Modules
Next: 8.15 B::Disassembler
 

8.14 B::Deparse

Perl compiler backend that generates Perl source code from the internal compiled structure of a program. The output won't be exactly the same as the original program, but it will be close. Invoke as:

perl -MO=Deparse[,options] program
program is the name of the program to be deparsed. The options are comma-separated and follow normal backend option conventions. The possible options are:
-l

Adds #line declarations to the output based on line and file locations of the original code.

-p

Prints parentheses wherever they are legal, not just where they are required. Useful for seeing how Perl is parsing your expressions.

-sletters

Provides style options for the output. In this initial release, the only style option provided is C, which "cuddles" else, elsif, and continue blocks so that, for example, you would get:

} else {
instead of:
}
  else {
The default is to not cuddle.

-uPackage

Deparses subroutines in package Package as well as the main program, subroutines called by the main program, and subroutines in the main program. Multiple -u arguments can be given, separated by commas.


Previous: 8.13 B::DebugPerl in a NutshellNext: 8.15 B::Disassembler
8.13 B::DebugBook Index8.15 B::Disassembler

Library Navigation Links

Copyright © 2001 O'Reilly & Associates. All rights reserved.