ディレクトリ内のファイルを全て削除
my $DirectoryPath = '/hogehoge/hogehoge'; opendir(DIR, $DirectoryPath); unlink map { $DirectoryPath.'/'.$_ } grep { -f $DirectoryPath.'/'.$_ } readdir DIR; closedir(DIR);
ディレクトリは削除されません。
my $DirectoryPath = '/hogehoge/hogehoge'; opendir(DIR, $DirectoryPath); unlink map { $DirectoryPath.'/'.$_ } grep { -f $DirectoryPath.'/'.$_ } readdir DIR; closedir(DIR);
ディレクトリは削除されません。