in reply to Divert STDOUT temporarily
IMHO the best way is Capture::Tiny's capture_stdout, or capture if you want to grab STDERR as well.