#!/usr/bin/perl -w use strict; use warnings; use File::Copy; open(LOGFILE, ">> C:/Logs/RPT_APPEND.log"); my $targetfile = "C:/testrpt.txt"; my $procdate = sprintf "%04d%02d%02d %02d:%02d:%02d", (localtime)[5]+1900, (localtime)[4]+1, (localtime)[3], (localtime)[2], (localtime)[1], (localtime)[0]; my @rpts = glob('//testserver/dir/*'); foreach my $x (@rpts) { print $x . "\n"; copy($x, $targetfile); }