我是新來的Perl,我想創建一個腳本,可以從不同的擴展名複製幾個文件從一個目錄到另一個。我試圖使用一個數組,但不知道如果這是可能的,但如果它更容易,我打開其他方式。使用不同的擴展名複製文件
我的代碼看起來像這樣;
my $locationone = "filepath"
my $locationtwo = "filepath"
my @files = ("test.txt", "test.xml", "test.html");
if (-e @files){
rcopy($locationone, $locationtwo)
}
該代碼可能有點粗糙,因爲我要離開我的頭頂,我還是perl的新手。
我真的很感謝幫助。
Regards
這個工作,非常感謝你對你的幫助:) – user2099445