我已經上市目錄中的所有文件,下面的代碼,我有路徑解決麻煩,我的目錄是爲* 的/ tmp/ *,基本上我想要的文件這些目錄位於tmp目錄中。但我不允許使用*,你有什麼想法嗎?相對尋址在Perl中,使用開放DIR
my $directory="*/tmp/*/";
opendir(DIR, $directory) or die "couldn't open $directory: $!\n";
my @files = readdir DIR;
foreach $files (@files){
#...
} ;
closedir DIR;
它的工作:) thx – shaq 2012-08-14 15:45:10
試着玩\ */tmp/\ * * – CyberDem0n 2012-08-14 15:47:17
我改了*/tmp/ – shaq 2012-08-14 15:48:19