in reply to Perl execution

As far as I understand, no object output file is created during compilation of perl code and While running the code , each line is interpreted and executed before proceeding to next line.
You understood that wrong.

Perl is neither purely compiled; nor purely interpreted. It is a bit of both and neither.

The perl executive reads the whole program and "compiles" it into an intermediate form, which then gets interpreted. Changing the source of your Perl script from within the program comes too late as your program has already been read in and compiled and it runs now out of its internal represenation which is utterly disconnected from the source text.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics

Replies are listed 'Best First'.
Re^2: Perl execution
by Anonymous Monk on Jul 05, 2012 at 14:09 UTC
    Not to mention the notion of "changing the source-code in mid-flight" is incredibly dangerous even if it did work.