看板 Perl 關於我們 聯絡資訊
自問自答 謝謝版上的文章 和協助我的人們 -- #!/usr/bin/perl -w open FILE, "data.txt"; $bool = 0; $count = 0; while (<FILE>) { if (/第一個關鍵字/){ $bool = 1; } if (/ 第二個關鍵字 / && $bool){ $count++; $bool = 0; } } print "\ntotal: $count\n"; -- -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 123.205.39.4