in reply to How to redirect STDOUT to an array (not executing program)
Searching for STDOUT on CPAN yields several implementations of a tied STDOUT which allows you to capture/redirect output: