Counting IPv4 addresses with a bitmap

I had this task to count IPv4 addresses, but the typical way of counting with a hash has problems. With Perl, you might think to just use each item as the hash key and increment its value each time you find one. However, when you are looking at most of the IPv4 space, or even half of it, that’s a couple billion keys that might not fit into memory. Remember, each of those values are a scalar value…