D
die
# This can be tested from the command line.$file2 should be an exact copy of
$file1
# with a current creation time.
# NOTE: Other file statistics would also be changed.
#---------------------------------------------------------------------------
----------
$file1='C:/Perl/eg/temp/file1.html'; # put original files in temporary
folder
$file2='C:/Perl/eg/file1.html'; # copy new files to another
directory
unless(-e "$file2"){ #just a precaution
use File::Copy; #method-use File::Copy;
copy("$file1","$file2");
use File::Compare; #use File::Compare;
if(compare("$file1","$file2")==0){
print"exact copy created\n";
}
}else{
print"file already exists";
}
#---------------------------------------------------------------------------
$file1
# with a current creation time.
# NOTE: Other file statistics would also be changed.
#---------------------------------------------------------------------------
----------
$file1='C:/Perl/eg/temp/file1.html'; # put original files in temporary
folder
$file2='C:/Perl/eg/file1.html'; # copy new files to another
directory
unless(-e "$file2"){ #just a precaution
use File::Copy; #method-use File::Copy;
copy("$file1","$file2");
use File::Compare; #use File::Compare;
if(compare("$file1","$file2")==0){
print"exact copy created\n";
}
}else{
print"file already exists";
}
#---------------------------------------------------------------------------