in reply to how perl interpreter works?

G'day pankaj verma,

Welcome to the monastery.

"perlmod: BEGIN, UNITCHECK, CHECK, INIT and END" may be sufficient for your needs. It contains an example script that reports what's happening from where the interpreter starts the compilation phase (BEGIN); the various stages between the compilation and execution phases (UNITCHECK, CHECK and INIT); through runtime to where the interpreter exits (END).

If you're after more technical details, see the links in "perl: Internals and C Language Interface". You'll find the perlinterp link, recommended by LanX above, in this section.

-- Ken