in reply to Collect prints to a string

One way to effectively buffer your print output is to open a filehandle directly to a scalar variable, then select the filehandle. Then you can print to STDOUT at a later time. This allows you to avoid modifying your sub. The following snippet is UNTESTED:
my $out; open my $fh, '>', \$out or die "cant open variable\n"; select $fh; print1('foo'); # do some stuff print STDOUT $out;