in reply to memory restiction ?

Hmm, using backticks will grab all error messages from the child process. Why not use system and redirect output from the compiler to a temporary file (within the string passed to system)? If there are errors returned, display the temporary file with Perl.