ディレクトリ内のすべてのファイルをリストするための次のコードがあります。パスのアドレス指定に問題があります。私のディレクトリは* /tmp/ *です。基本的に、tmpディレクトリのディレクトリにあるファイルが必要ですが、許可されていません。 * を使用してください。
my $directory="*/tmp/*/";
opendir(DIR, $directory) or die "couldn't open $directory: $!\n";
my @files = readdir DIR;
foreach $files (@files){
#...
} ;
closedir DIR;