可能重複:
How do I pass parameters to the File::Find subroutine that processes each file?如何在使用Perl的File :: Find時將參數傳遞給想要的函數?
人們可以使用Perl的File::Find模塊是這樣的:
find(\&wanted, @directories);
我們如何可以添加一個參數到wanted
功能?
例如,我想遍歷/tmp
中的文件,從每個文件中提取一些信息,並將結果存儲到不同的目錄中。輸出目錄應該作爲參數給出。
請描述更具體的你正在嘗試做的,我會更新我的答案。 –
另請參閱http://stackoverflow.com/questions/2056649/how-do-i-pass-parameters-to-the-filefind-subroutine-that-processes-each-file –
@ SinanÜnüryour remark http:///stackoverflow.com/questions/2056649/how-do-i-pass-parameters-to-the-filefind-subroutine-that-processes-each-file 解決了我的問題。如果您將它作爲答案發布,我將標記爲已接受 – jojo