in reply to Generation of sequential IP addresses for Class B network
Take a look at Net::IP and NetAddr::IP.