in reply to Re: Compressing .sigs more
in thread Compressing .sigs more

That partly helps, but I do need to do the filtering and lookup on that Received header.

--
$Stalag99{"URL"}="http://stalag99.keenspace.com";

Replies are listed 'Best First'.
Re: Re: Re: Compressing .sigs more
by jynx (Priest) on Sep 21, 2001 at 01:16 UTC

    here's my next attempt,

    Actually, this is two attempts. After playing around with my original twist a couple of times, i found that to do what it needs to do it would have to be longer than your original code. So i instead took your original code and chopped off unimportant bits and did some reformatting. Both of the following snippets seem to test out correctly (using warnings and strict):

    /^Received[^\[]+\[(\d+).(\d+).(\d+).(\d+)]/?`host $4.$3. $2.$1.$ARGV[0] 2>&1`=~/$ARGV[1]/m&&exit 0:1while<STDIN>; exit 1 while(<STDIN>){s/^Received[^\[]+//&&s/].*//?($_='host ' .(join'.',(reverse map{s/(\D+)//;$_}split/\./),$ARGV[0] ).' 2>&1',`$_`=~/$ARGV[1]/m&&exit 0):1}exit 1
    The first one is based off of yours, i'm sure there's a way to squeeze it further, but i can't see it from here. The second is a re-working of my previous answer, and is obviously inadequate space-wise.

    Hope This Helps,
    jynx


    PS i'm not sure how space-conscientious you want to be, but you could also shorten the first line to:

    eval join"",map{chop;s/^[^>]+>\s*//&&$_}<DATA>__END__
    if you're really desperate for space. As always, it could probably be shortened more... :)