spock:~ [21:48:04]$ perl -lne '($_+0) =~ /[1-5]/ and print "\$_ is ok"' 0 3 $_ is ok 145 $_ is ok