in reply to Compressing .sigs more
It looks like the part you want changed is the last three lines of perl, kinda like so:
Well, the best i could come up with looks something like this:while(<STDIN>) { chomp; if (/^Received:[^\[]+\[(\d+)\.(\d+)\.(\d+)\.(\d+)\]/) { $n=`host $4.$3.$2.$1.$ARGV[0] 2>&1`; exit(0) if ($n=~/$ARGV[1]/m); } } exit(1);
(or if we spread that out for readability):while(<STDIN>){$_="host ".join'.',map{s/(\d+)/$1/}split /./."$ARGV[0] 2>&1";`$_`=~/$ARGV[1]/m&&exit 0}exit 1
Which reduces it one line. It has not been tested well at all (but should have the same functionality), and could probably be reduced more. Does this help at all?while (<STDIN>) { $_= "host " . join '.', map {s/(\d+)/$1/} split /./ . "$ARGV[0] 2>&1"; `$_` =~ /$ARGV[1]/m && exit 0 } exit 1
jynx
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Compressing .sigs more
by strredwolf (Chaplain) on Sep 20, 2001 at 08:23 UTC | |
by jynx (Priest) on Sep 21, 2001 at 01:16 UTC |