#!/usr/local/bin/perl use warnings; use strict; for (qw(1 5 10 a 4 0 deadbeef 357 Albuquerque)) { warn "Bad input $_\n" and next unless /^([1-7])$/; print "Good input $1\n"; }