Or even simpler...
#!/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"; }
Update: erp! Left out untainting bit. Minor edit to untaint data.
In reply to Re^2: form checking checkboxes
by thundergnat
in thread form checking checkboxes
by tanger
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |