m/\d{4}\-\d{2}/ - m/d{2}/ #### for (@list) { next unless $_; unless ( m#\d{4}\-\d{2}\-\d{2}# ) { print "$_ is invalid, the date fields MUST be filled out correctly!"; exit; } }