in reply to Re: Add timestamp to file being copied.
in thread Add timestamp to file being copied.

Hello, It seems to work. I made one minor changes as the month day and year seem to be a better identifer.
foreach my $upload (@uploads) { my $newName = $upload; $newName =~ s/\.zip$/-${mday}-${mon}-${year}.zip/; copy ($logSite . ${upload}, $localCpPath . $newName)or die "F +ailed to copy"; print "File $upload has been copied over and renamed $newName +\n"; }
I had one further question. I forgot to mention the files can eitehr be .zip or .zip.meta Now I see that we are only zip files with the pattern matching. What would be the best way so it changes the meta file aswell. If statement perhaps in the middle of the for loop?