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?
Two related questions
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.