What does the -p do in the following line:
perl -MO=Deparse,-p
also, is there a one liner that will run deparse, and tidy on a file at
the same time? or is that stupid?
preservation of comments would be nice but isn't critical.
Thanks.
The deparse documentation says that -p adds parentheses to the output,
even where they're not required. (If you're not aware, the O module is
a frontend to the compiler backends under B::*, and deparse is a backend
properly called B:
eparse. The command "perldoc B:
eparse" shows the
deparse documentation.)
If your tidy program can run as a filter (read from STDIN, write to
STDOUT), you could run it as a filter like:
perl -MO=Deparse file.pl | tidy - > deparsed.pl
Alternately, if your tidy program can't be made to run as a filter, you
could write a shell script (or even a Perl script) that saves STDIN to a
temporary file, runs the tidy program, then reads the temporary file to
STDOUT.
As far as comments go, Perl junks them before deparse even runs.