in reply to doubts of a perl beginner in G_EVAL(perlEmbed)
Admittedly your friend's code is ill-mannered, but if it's UNIX, could you just use fork(2) and either wait(2) or waitpid(2), putting the G_EVAL in the child process? (I think StartProcess could be similarly applied on Windows, but have never tried.)