http://qs321.pair.com?node_id=170664

jotti has asked for the wisdom of the Perl Monks concerning the following question: (cgi programming)

What happens when my CGI Perl script is called? Is every line interpreted every time the program comes to the line? F.i. if I have the following lines:

for (i = 0; i < 100; i++) { print "Hello, World\n"; }
...will the print line be interpreted 100 times? (I believe this was the case in old great interpreters like GWBASIC and QBASIC.) Or is the whole script compiled once every time it is called and then run like a compiled C++ executable CGI "script"?

Originally posted as a Categorized Question.