[PLUG] Perl sorting problem...

someone plug_1 at robinson-west.com
Mon Aug 8 03:04:37 UTC 2011


Quoting Fred James <fredjame at fredjame.cnc.net>:

> someone wrote:
>> (omissions for brevity)
>
>>                     if ( $tmp > $last_lowest )
>>                     {
>>                          $lowest=$tmp;
>>                     }
>>
> (omissions for brevity)
>
> Quick question ... is this (above) what you really want to say?

The last_lowest is the last value written out to the file.
The tmp value is the current value plucked from the list.
My hope by going through all the values and picking every one that
is larger than the last smallest one, the next one will be grabbed.

By the way, I can't get Perl's sort function to do the right thing
exactly either.

  my @sorted_ips=sort {$a <=> $b} @ip_list;

This command sorts the first octet correctly, but not the second,  
third, or fourth octets.  The numbers are in binary format when sort  
is run on them.

I don't undersand the special syntax on the sort command, but I suspect that
I need something different there.

The beauty of the sort function, if it will work, is that I can  
replace an entire function that is fairly long in comparison.  This is  
why I'm using perl after all, it is supposed to be designed to do this  
sort of thing.

My perl script is fairly short right now, but it is long enough to be  
obnoxious.
I would have attached it instead, but I don't think attachments are allowed.

I want to give my solution, which this isn't yet, away.  To get  
tarpitting to work, everyone has to do it eventually.  I'm sitting on  
200-300 spams which seems to be limited only by my bandwidth at this  
point.  I don't like MailScanner and I've given up on SpamCannibal,  
good idea badly implemented.

Thank you for taking a look.

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




More information about the PLUG mailing list