Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Grabbing Variable Names

by diotalevi (Canon)
on Jan 12, 2003 at 05:57 UTC ( #226209=note: print w/ replies, xml ) Need Help??


in reply to Re: Grabbing Variable Names
in thread Grabbing Variable Names

B::Xref, like the other B modules, looks through the internal bytecode generated by perl, so thus reuses perl's parser
Oh I hate that mischaracterization. Perl doesn't normally have anything to do with bytecode. When the perl compiler parses perl (between toke.c and perly.y) it just constructs a bunch of C structs in memory. That's it. Those structs are the OP codes people sometimes mention. They're named stuff like enter, leave, const, padsv, print, etc. Perl executes by following these things around and occasionally triggering a C routine or two.

The only reason people ever mention bytecode is when making some Java comparison or when attempting to use B::Bytecode. Perl's bytecode is just a serialization of the opcode tree. It's also not a particularly effective hack either - (it's never worked for me).

So please, don't go on about Perl's bytecode. It doesn't use any. Unless you really mean to force the issue but that doesn't count because it's just loading another module. It's not actually 'perl'


Comment on Re^2: Grabbing Variable Names
Re: Re^2: Grabbing Variable Names
by theorbtwo (Prior) on Jan 12, 2003 at 07:28 UTC

    I stand corrected. Though, actualy, I think people use the term "bytecode" somwhat incorrectly (and I say only somewhat) because the B::* tree is named B-for-Bytecode (OK, it's actualy not, it's B-for-Backend, but I think it's confusingly similar), and it's original purpose was that ineffective hack.

    In any case, do you have a better term then bytecode, other then "opcode tree", which seems a little unwieldy?


    Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

      "Optree". :) That's what I've mostly seen used by perlguts people.

      Makeshifts last the longest.

      The B:: tree is also named after it's author, Malcolm Beattie. See, if the module tree is named 'B' then he can type "perl -MB ..." and get cool stuff to happen just by typing his initials. Frankly... I don't usually think of 'B' as short version of anything else. That's just it's name.


      Fun Fun Fun in the Fluffy Chair

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://226209]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (13)
As of 2014-07-14 14:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (261 votes), past polls