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


in reply to Re^2: Why am I getting "premature end of script header"?
in thread Why am I getting "premature end of script header"?

My solution already does exactly that. Just replace the body of if ($@) with whatever you want.

What you have there is the same as

eval ("use fakemodule;"); if ($@) { print "error happened $@"; } else { print "error didnt happen, do some stuff"; } print "Content-type: text/html\n\n"; print "here we go again..."; &a; sub a {}