Where does Perl store its intermediate byte code?

After going through couple of linksI came to know that Perl does the compilation and create an intermediate byte code and then interpret that byte code. My question is where does that byte code reside?

Like in other language like java, c we can see the machine executable object code after compilation. Though Perl doesn't create machine executable code, but there should be some location where it stores the byte code temporarily.

Answers


The result of the compilation is stored in memory as a tree of opcodes, or optree for short. This structure is being walked by perl's runtime to execute your program.

You will probably find the "Compiled Code" section of perlguts interesting. It explains many of the details of building an executing a perl optree.

It's also sort of possible to write that optree out to disk and load it again into another perl process, using the B::C distribution and the ByteLoader module contained in it. However, this technique doesn't work all that well on many programs, so it's not recommended in any way.


It stores it in memory as an AST.


Need Your Help

How to resize an image i picked from the gallery in android?

android image resize gallery

I am building an android where. Inside of one activity I have an image button. When I click on it the gallery opens up and I can choose an image. Then I set that image as the new image for the image

How to use NSString drawInRect to center text?

objective-c cocoa macos

How can I draw a NSString centered within a NSRect?