in reply to perlembed: perl_run twice?

Not really answering your question, but wondering if using Perl.pm is the right way to do it considering the problems you have with it.

The traditional perl way to get the required effect is persistent already interpreted code by using something like SpeedyCGI (which is not CGI only whatever its name may suggest) or PPerl.