in reply to Copy contents of STDOUT
You could override print with your own subroutine that would cache (i.e simply push into an array) everything that is printed
Overriding so that you don't have to change anything else in your script is possible but might be difficult to get right (see http://search.cpan.org/~dapm/perl-5.10.1/pod/perlsub.pod#Overriding_Built-in_Functions____ )
Easier is to change all STDOUT print statements to a simple call to your subroutine that does the caching and then prints
|
|---|