in reply to "or" or "||" problems
You have a couple of '/' for '\' typos in the regex, and from your description, you should use the eq operator instead of ne. Also your $Flag variable is global and not reset, so if the first element of @list passes, the print and exit sequence is never reached.
Does this work for you?
for (@list) { if (! /\d{4}\-\d{2}\-\d{2}/ or $_ eq '') { die 'The date fields MUST be filled out correctly!', $/; } }
I changed the print; exit; sequence to die so that throw/catch can be done with eval, or a __DIE__ handler invoked. That will print the message to STDERR instead of the selected output handle.
You seem to suggest that or does not short-circuit. False, || and or only differ in operator precedence.
After Compline,
Zaxo
|
|---|