Two related questions
- After I run a program how can I see what machine code got executed?
- Moreover does perl execution convert the whole pl and its modules to machine code or just the part it executes?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Perl is an interpreted language. A more detailed look at how Perl works shows that perl has some features of compilers, some of interpreters. For more info see the introduction to perlrun and the compiler section of perlguts.
Perl is compiled into a set of opcodes that are executed by a virtual machine that is part of the perl binary. You can see these opcodes by using a tool like B::Concise.
If you want to see actual processor specific instructions, you are going to have to do some serious black magic. You could run perl on a special virtual machine that is configured to record all instructions executed by a given executable.
Another possible approach is to use B::C to create a compiled C version of your Perl script. You can then examine the native compiled code.