use File::Copy;
copy('file1.txt','file2.txt') or die "can't copy: $!\n";
複製目錄
sub copy_dir{
my $source = $_[0];
my $target = $_[1];
use File::Copy;
opendir(DIR,$source);
while(my $filename = readdir(DIR)){
if(-f "$source/$filename")){
copy("$source/$filename","$target/$filename") or die "can't copy: $!\n";
}
}
close(DIR);
}
參考網頁
2005
6
1月
- Posted by citypig at 12:27 am (82 views)
- No comments published
- Filed under: perl


