The 'on the fly' remark is a little misleading. Yes, Perl is an interpreted language. However, it's compiled into bytecode and then executed, when possible. (Things like
eval which make my life more convenient can be evaluated at run time.)
The compiler's pretty good about optimizing things, as you'd expect from Real Computer Scientists, so there are things Perl can do faster than the corresponding C program. In other cases, Perl may be slower, but even taking that into account, it's faster to write, debug, and execute a Perl program that runs at half the speed of a C program that takes twice as long to write and to debug.
The O'Reilly site has chapter 18 (or so) from the new Camel available online, and it goes into the life cycle of a Perl program including the compilation stage. Could be worth a look.