shouldn't it be "B::Deparse"?"

perl -MB::Deparse -e"foo()"
is the same as
perl -e"use B::Deparse; foo()"

You can use Deparse to see that:

>perl -MO=Deparse -MB::Deparse -e"foo()" use B::Deparse; foo(); -e syntax OK

B::Deparse loads functions to deparse Perl code. But since you never use the module, it's rather useless to load the module.

O, on the other hand, behaves very specially when loaded. It loads the program, dumps it using the specified dumper (e.g B::Deparse), and prevents it from executing as if -c had been specified.

>perl -MO=Deparse -e"foo()" foo(); -e syntax OK >perl -MO=Concise -e"foo()" 6 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 1 -e:1) v:{ ->3 5 <1> entersub[t2] vKS/TARG,1 ->6 - <1> ex-list K ->5 3 <0> pushmark s ->4 - <1> ex-rv2cv sK ->- 4 <#> gv[*foo] s/EARLYCV ->5 -e syntax OK >perl -MO=Terse -e"foo()" LISTOP (0x19298c0) leave [1] OP (0x19298a4) enter COP (0x19298e4) nextstate UNOP (0x1929920) entersub [2] UNOP (0x192995c) null [142] OP (0x1929940) pushmark UNOP (0x1929980) null [17] PADOP (0x19299a0) gv GV (0x182a00c) *foo -e syntax OK

In reply to Re: B::Deparse vs. O=Deparse by ikegami
in thread B::Deparse vs. O=Deparse by bichonfrise74

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.