看板 Perl 關於我們 聯絡資訊
我也是新手....應該可以更短.... 請高手賜教....... ============================================================================== open file,"<session.txt"; while (<file>){ /(\d+\.\d+\.\d+\.\d+)/; $hash{$1}++ ; } close file; open file,">temp.txt"; print "$key = $value \n" while ($key,$value)=each %hash; close file; -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.228.124.101
softwind:請問 /\w+/; $hash{$1}++; 也可以嗎? 型態好像沒有差... 03/07 09:52
abliou:\w不是用在character嗎? 03/07 13:15