Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there runtime flow chart for Perl?

Tags:

perl

runtime

I am trying to better understand logic and flow of exceptions. So i got to state that i really feeled lack of understanding how Perl interpretes and runs programs, which phases are involved and what happens on every phase.

For example, I'd like to understand, when are binded STD* IO and when released, what is happening with $SIG{*} things, how they are depended with execepions, how program dies, etc. I'd like to have better insight of internals mechanics.

I am looking for links or books. I prefer some material which has also visual charts involved but this is not mandatory. I'd like to see some "big picture" of whole process, then i have already possibilities to dig further if i find it necessary.

I found Chapter 18th in Programming Perl gives overview of compiling phase and i try to work it trough, but i appreciate other good sources too.

like image 449
w.k Avatar asked Nov 27 '12 10:11

w.k


1 Answers

Some alternative sources (there are not very many):

  • Mannning's Extending and Embedding Perl, which is the go-to reference on Perl's internals outside of the source
  • The chapter on the Perl internals in Advanced Perl Programming, which may be exactly what you want
  • Simon Cozens's Perl internals FAQ

Those may be more focused to what you're looking for. I'm not sure any of them explicitly spells out the interpreter's runtime execution order, though. The first one is a better "I want to work with this stuff" book; the second two are probably good introductory references.

Some of the questions you ask are not, as far as I know, explicitly documented - the I/O question being one I can't think of a good source for in particular. Exception handling is documented very well in Try::Tiny's documentation, and it's what we use for exceptions. Signal handling is messy, but perlipc documents it pretty well. With threads, you may be stuck with unsafe signals - I generally avoid threads in favor of multiple processes unless I must have shared memory.

like image 66
Joe McMahon Avatar answered Oct 17 '22 06:10

Joe McMahon