my $output; while () { $output .= $line; } print FILE $ouput;