[aklug] Re: perl lists question, sorting, sort of.

From: Joshua J. Kugler <joshua@eeinternet.com>
Date: Tue Aug 17 2010 - 12:26:35 AKDT

On Tuesday 17 August 2010, Lee elucidated thus:
> Apparently, from what I read, doing the hash thing will simply take
> the last element, since the 'key' (that is the ip) is exclusively
> indexed. Testing seems to bear this out.
>
> I can also brute force it was a lot of loops and conditionals.
> That's an option.
>
> But, before I do that, is there an easy, 'perl-y' way to do this?

How about a hash of arrays?

key is the IP
the value is an array onto which you push the host names.

j

-- 
Joshua Kugler
Part-Time System Admin/Programmer
http://www.eeinternet.com
PGP Key: http://pgp.mit.edu/  ID 0x73B13B6A
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Tue Aug 17 12:26:49 2010

This archive was generated by hypermail 2.1.8 : Tue Aug 17 2010 - 12:26:49 AKDT