in reply to "or" or "||" problems

I think, this should help you, from what I understand from ur query. foreach (@list) {if (! /\d{4}\-\d{2}\-\d{2}/ && $_ ne '') {$Flag=1;}} if ($Flag ==1) {print "The date fields MUST be filled out correctly!"; exit;} Hope it Helps. Cheers!!!! Anandatirtha

Replies are listed 'Best First'.
Re: Re: "or" or "||" problems
by Anonymous Monk on Nov 07, 2002 at 04:52 UTC
    A little correction , since you need to validate each element in the @list array. the pattern checking sequence must be within the foreach loop. foreach (@list) {if (! /\d{4}\-\d{2}\-\d{2}/ && $_ ne '') {$Flag=1;} if ($Flag ==1) {print "The date fields MUST be filled out correctly!"; exit;}} This is about it. Anandatirtha