2009/8/24 owen nirvana <[email protected]> > 在文件里搜索一个特定的字符串,file:find只能按路径遍历文件,我不知道如何使被find引用的函数带上一个关于待搜索字符串的参数,like > > find(\&wanted, @directories_to_search, params) >
在文件内容里搜索东西需要用 grep 或者 ack 啦,呵呵。可以尝试在上例的 wanted 函数里用 Perl 5 自己实现一个简单的 grep 哈 :) Cheers, -agentzh --~--~---------~--~----~------------~-------~--~----~ 您收到此信息是由于您订阅了 Google 论坛“PerlChina Mongers 讨论组”论坛。 要在此论坛发帖,请发电子邮件到 [email protected] 要退订此论坛,请发邮件至 [email protected] 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛 -~----------~----~----~----~------~----~------~--~---
