I am a total beginner and have a script like this:
It runs fine the only problem is it does not copy the data in output1.txt to output3.txt. It creates output3.txt but does not copy the data. Why?
#!/usr/bin/perl
my $server = `uname -n`;
print $server;
chomp $server;
# Display all the files in /tmp directory.
$dir = "/usr/ent/newdir/db/sign/*";
my @files = </usr/ent/newdir/db/sign/*files*>;
open(my $outfh, '>', '/tmp/output1.txt') or die "cannot open file";
foreach $LINE (@files ){
print $outfh $LINE;
close FH;
}
use File::Copy;
{$oldlocation = "/tmp/output1.txt";
$newlocation = "/tmp/output3.txt";
copy($oldlocation, $newlocation);
}
Server Error (Error ID 5713118c2136655)An error has occurred. The site administrators
have been notified of the problem and will likely
soon fix it. We thank you, for you're patients.