in reply to Working with large amount of data

1 billion is roughly 25% of the total number of possible IPs (2**32), so your best option would probably be to use a bit vector that will take 1/2 GB of memory (2 ** 32 / 8).

It seems that the biggest index that can be handled by Perl vec() built-in is 2**31 - 1, so, as a work around you could use two vectors, one for IPs in the range 0 to 0x7fffffff, and other for 0x80000000 to 0xffffffff.