Whoaaaa, you've got to be a bit more specific, here. What do you mean by "as much as it can about a particular subnet"? All valid hosts? Broadcast address? Network address? Try to go out on the network and see how many responses you get from devices sitting on a "particular subnet"? All of the above? None of the above?
I think that you would be more successful in your search for help if you:
1. Took a stab at it yourself, and posted the code that has you stumped.
2. Outline your specifications more clearly.
Also, you may want to check out NetAddr::IP and ipcalc