Re: perl deparse question.
- From: "it_says_BALLS_on_your_forehead" <simon.chao@xxxxxxxxx>
- Date: 30 Mar 2006 10:10:59 -0800
ewaguespack@xxxxxxxxx wrote:
What does the -p do in the following line:
perl -MO=Deparse,-p
http://search.cpan.org/~nwclark/perl-5.8.8/ext/B/B/Deparse.pm
-p
Print extra parentheses. Without this option, B::Deparse includes
parentheses in its output only when they are needed, based on the
structure of your program. With -p, it uses parentheses (almost)
whenever they would be legal. This can be useful if you are used to
LISP, or if you want to see how perl parses your input. If you say
if ($var & 0x7f == 65) {print "Gimme an A!"}
print ($which ? $a : $b), "\n";
$name = $ENV{USER} or "Bob";
B::Deparse,-p will print
if (($var & 0)) {
print('Gimme an A!')
};
(print(($which ? $a : $b)), '???');
(($name = $ENV{'USER'}) or '???')
which probably isn't what you intended (the '???' is a sign that perl
optimized away a constant value).
.
- References:
- perl deparse question.
- From: ewaguespack
- perl deparse question.
- Prev by Date: Re: perl deparse question.
- Next by Date: Re: A Problem With GD
- Previous by thread: Re: perl deparse question.
- Next by thread: Re: perl deparse question.
- Index(es):
Relevant Pages
|