看板 Perl 關於我們 聯絡資訊
請愛用 File::Find::Rule: use File::Find::Rule; # find all the subdirectories of a given directory my @subdirs = File::Find::Rule->directory->in( $directory ); # find all the .pm files in @INC my @files = File::Find::Rule->file() ->name( '*.pm' ) ->in( @INC ); 一行解決。 ※ 引述《a3181388 (Mr.3181388)》之銘言: : : # find預設會遞迴搜尋資料夾下的檔案 (preorder traversal) : : find(\&wanted, @ARGV); : : # 印出@ARGV中所有檔案、目錄底下的檔案的檔名 : : say join " ", @files; -- qr{Cornelius|c9s}; -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 113.61.199.4