The script works like grep, but for subnets specified by ip/mask. The beginning of the script explains it more details (228 lines):
subnet-grep.pl
Thanks
In reply to Looking for feedback on a script by systemj