1
可能重複:
How can I pass command-line arguments to a Perl program?perl的輸入多個文件
我有一個Perl腳本,我需要在命令行中運行,但也提供了三個輸入文件和一個輸出。我不想做一個STDIN,因爲我正在編寫一個包裝腳本來多次爲多個文件使用perl腳本。
所以,我現在這樣:
open (FICHIER, "<$file1") || die "file not found";
chomp($file1);
@b=<FICHIER>;
open (SPECIES, "<$file2");
$species=<SPECIES>;
chomp($species);
open (FILE3, "<$file3>");
$file3 = <FILE3>;
chomp($file3);
open (OUTFILE, ">$outfile");
chomp($outfile);
我需要做這樣的事情:
perl的myscript.pl textfile1 textfile2 textfile3 OUTPUTFILE
我需要$文件1來表示textfile1, $ file2 for textfile2等
在此先感謝
馬克