use File::Copy; open FH, "> xyz" or die "Write xyz - $!"; copy( $_, \*FH ) for qw( xy z ); close FH;