#!/usr/bin/perl use strict; use warnings; use File::Copy; my $buffer = <', 'foo.txt'; print $fh $buffer;