use IO::Scalar; tie *STDOUT, 'IO::Scalar' => \my $stdout; find( \&fetcher, "/directory" ); untie *STDOUT; print "\n\nTotal Count = $ct\n\n"; print $stdout;