in reply to IP Address/Subnet matching

Convert elements of @blocklist,and the "one IP address", into NetAddr::IP objects.
Those objects support the method:
$me->contains($other) #Returns true when $me completely contains $other. False is returned + otherwise # and undef is returned if $me and $other are of different versions. #Note that $me and $other must be NetAddr::IP objects.
You can then use grep to filter the list of objects, limiting them to thost where the condition is TRUE.

     "For every complex problem, there is a simple answer ... and it is wrong." --H.L. Mencken