Re: perl deparse question.
- From: Donald King <dlking@xxxxxxxx>
- Date: Thu, 30 Mar 2006 12:46:01 -0600
ewaguespack@xxxxxxxxx wrote:
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::Deparse. The command "perldoc B::Deparse" 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.
--
Donald King, a.k.a. Chronos Tachyon
http://chronos-tachyon.net/
.
- References:
- perl deparse question.
- From: ewaguespack
- perl deparse question.
- Prev by Date: OT: Copyright protection (was Re: A Problem With GD)
- Next by Date: Re: Converting codepages to UTF8
- Previous by thread: Re: perl deparse question.
- Next by thread: Windows Hooking
- Index(es):
Relevant Pages
|
|