Re: Java v Perl dashing golf

[email protected]
Newsgroups perl.golf
Message-ID <694BB7191495D51183A9005004C0B0540142F9D8@ir-exchange-srv.ir.com.au>
En op 18 september 2002 sprak `/anick:
>	Hmm... Make me want to rush back at my Java books, this
> sure doesn't...

Perl has been beaten on this problem by both egrep and gawk.
The egrep and gawk versions below are both a little faster
(on Linux) and a little shorter too. egrep was the fastest
in my test.

#!/bin/sh
egrep -v '\.(gif|GIF|jpg|JPG|css|CSS) HTTP|^192\.(9|18|29)\.' inf >e

#!/bin/sh
gawk '!/\.(gif|GIF|jpg|JPG|css|CSS) HTTP|^192\.(9|18|29)\./{print}' inf >a

#!/bin/sh
perl -ne'/^192\.(?:9|18|29)\./||/\.(?:gif|GIF|jpg|JPG|css|CSS) HTTP/ or
print' inf >p

/-\ndrew
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.