!/usr/bin/perl -slw use strict; use warnings; use Net::Subnet; my $is_rfc1918 = subnet_matcher qw( 10.96.2.0/255.255.254.0 10.123.50.0/255.255.255.0 72.24.196.0/255.255.255.0 72.24.137.192/255.255.255.192 10.122.50.0/255.255.255.0 ); print $is_rfc1918->('10.96.2.0') ? 'yes' : 'no';