tags:

views:

174

answers:

1

Hi,

perl -MO=Concise,-exec myprog.pl

should do it but it only prints the syntax of the lines that are outside any procedures, and the main package itself. It does not print the syntax tree of packages and functions used in myprog and imported. Could someone tell me how to tell "B::Concise" to print all functions in myprog.pl.

+4  A: 

From the documentation:

Arguments that don't start with a hyphen are taken to be the names of subroutines to render; if no such functions are specified, the main body of the program (outside any subroutines, and not including use'd or require'd files) is rendered.

So to enter subroutine mysub(), as well as print the syntax tree of the main package itself, use perl -MO=Concise,-exec,-main,mysub myprog.pl. There is no option meaning "all subs" - you have to specify each one explicitly by name.

Ether