I'm probably missing something, but can you put the test in a separate process (e.g. qx() a separate script) and then grab and parse the STDERR output from that?
I tried that with system() and it didn't work. I can try it with qx//, although I'm not sure what'll happen. Sorry I'm not too much with the specifics, I'm posting replies from elsewhere right now.