Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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'

Replies are listed 'Best First'.
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).

      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

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

      Makeshifts last the longest.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2020-03-29 19:02 GMT
Find Nodes?
    Voting Booth?
    To "Disagree to disagree" means to:

    Results (171 votes). Check out past polls.