比對中文出不來??

看板Perl作者 (只愛Calvin Klein)時間20年前 (2004/10/22 16:16), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
use File::Find; # 指揮 perl 至 perl 的主要目錄下尋找 File/Find.pm 這個 # 模組,引入使用! 其中 :: 相當於 / 這個符號。 # 路徑設定 my $dir=shift || '../www'; # 抓取使用者欲比對的字串 print"請輸入您欲比對的字串:"; chomp($string=<STDIN>); # 走訪該目錄 find(\&doit, $dir); # 動作區 sub doit { open(FIN, $File::Find::name); #foreach $tmp (<FIN>){ if(/\w+/) { if(grep{/\b$string\b/i} <FIN>) { print"http://$_\n"; } }elsif(grep{/$string/} <FIN>) { print"http://$_\n"; print"$File::Find::name"; } # $tmp =~ s/<[^>]*>//g; # print"$tmp\n"; #print(grep{/$string/} <FIN>."\n"; } 這段程式比對英文成功可以印出網址~~ 但是中文怎麼沒東西?? 謝謝^^ -- http://www.wretch.twbbs.org/album/krist ^^" -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.162.212.82
文章代碼(AID): #11UC7KP4 (Perl)
討論串 (同標題文章)
文章代碼(AID): #11UC7KP4 (Perl)