如何用perl正则表达式过滤apache日志文件?

如何用perl正则表达式过滤apache日志文件?

121.16.63.168 - - [23/Nov/2007:18:10:47 +0800] "GET /whois/whois.htm HTTP/1.1" 200 16628
121.16.63.168 - - [23/Nov/2007:18:10:50 +0800] "GET /css.css HTTP/1.1" 200 787
121.16.63.168 - - [23/Nov/2007:18:10:50 +0800] "GET /pay_pic/Main/spacer.gif HTTP/1.1" 200 43
121.16.63.168 - - [23/Nov/2007:18:10:51 +0800] "GET /pay_pic/Main/index_10.gif HTTP/1.1" 200 178
121.16.63.168 - - [23/Nov/2007:18:10:51 +0800] "GET /pay_pic/Main/whois.gif HTTP/1.1" 200 2207
121.16.63.168 - - [23/Nov/2007:18:10:51 +0800] "GET /pay_pic/Main/index_12b.gif HTTP/1.1" 200 198
121.16.63.168 - - [23/Nov/2007:18:10:51 +0800] "GET /pay_pic/Main/index_13.gif HTTP/1.1" 200 245
121.16.63.168 - - [23/Nov/2007:18:10:51 +0800] "GET /pay_pic/Main/index_14.gif HTTP/1.1" 200 220
121.16.63.168 - - [23/Nov/2007:18:10:51 +0800] "GET /pay_pic/Main/index_16.gif HTTP/1.1" 200 203
121.16.63.168 - - [23/Nov/2007:18:10:51 +0800] "GET /pay_pic/Main/index_17.gif HTTP/1.1" 200 226
121.16.63.168 - - [23/Nov/2007:18:10:51 +0800] "GET /pay_pic/Main/index_18.gif HTTP/1.1" 200 193
121.16.63.168 - - [23/Nov/2007:18:10:51 +0800] "GET /pay_pic/Main/index_15b.gif HTTP/1.1" 200 196
121.16.63.168 - - [23/Nov/2007:18:10:51 +0800] "GET /pay_pic/Main/index_36.gif HTTP/1.1" 200 294
121.16.63.168 - - [23/Nov/2007:18:10:53 +0800] "GET /pay_pic/Main/index_07.gif HTTP/1.1" 200 5375
121.16.63.168 - - [23/Nov/2007:18:10:53 +0800] "GET /pay_pic/Main/index_06.gif HTTP/1.1" 200 8808
121.16.63.168 - - [23/Nov/2007:18:10:54 +0800] "GET /pay_pic/Main/index_15.gif HTTP/1.1" 200 215
121.16.63.168 - - [23/Nov/2007:18:10:54 +0800] "GET /pay_pic/Main/index_08.gif HTTP/1.1" 200 2580
121.16.63.168 - - [23/Nov/2007:18:10:54 +0800] "GET /pay_pic/Main/index_19.gif HTTP/1.1" 200 205
121.16.63.168 - - [23/Nov/2007:18:10:54 +0800] "GET /pay_pic/Main/index_20.gif HTTP/1.1" 200 251
上面是apache的格式,我想用perl把包含121.16.63.168这个IP的所有记录都删除,如何写啊,在线等待急。。
话说杀猪不用手术刀
zcat /var/log/thttpd.log.4.gz  | grep -v "^192.168.31.107"
shell何不直接grep -v "^xxxx" filename

perl的话, 如果文件不特别大就一次读入到list, 然后
@grep_lines = grep { ! /^xxxx/ } @lines;