note
tlm
<p>Though it is not the infallible oracle I once thought it was, I still make frequent use of
<c>
% perl -MO=Deparse,-p -e '<Perl code>'
</c>
...to figure out how perl is parsing something, or maybe to get a grip on some obfu. E.g. if you wonder what this one-liner does
<c>
-nle '}{print$.' foobar.txt
</c>
feed it to <tt>-MO=Deparse,-p</tt> (make sure to retain any other command line switches, like <tt>-nl</tt> here):
<c>
% perl -MO=Deparse,-p -nle '}{print$.'
BEGIN { $/ = "\n"; $\ = "\n"; }
LINE: while (defined(($_ = <ARGV>))) {
chomp($_);
}
{
print($.);
}
-e syntax OK
</c>
Note that the <tt>-p</tt> in this one-liner is part not perl's command line switch, but rather an argument to [mod://B::Deparse].
</p>
<p>Less commonly , I use other backends, such as [mod://B::Terse] and [mod://B::Concise], instead of [mod://B::Deparse]. See also [mod://O] and [mod://B].
</p>
<p><small>the lowliest monk</small></p>
470397
470397