in reply to Re: Redirecting and using output from executed program
in thread Redirecting and using output from executed program

Or if you want to keep STDERR, 2>&1 instead of 2>/dev/null would be nice. This may be sensitive to your choice of shell.

Also try the IO::Capture modules.