in reply to Capturing STDERR using IO::Handle

I think you can get what you need here. Also, you can find some other examples in the 'qx' section in perlop