Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2022-11-28 19:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?