You could "do" something like this: my $answer; do { print "Question: "; chomp ( $answer = <STDIN> ); print "Answer: $answer\n"; } while $answer !~ /^MDS[0-9]/;
Trevor Joerges SendMIME Software www.sendmime.com [EMAIL PROTECTED] ----- Original Message ----- From: "alex p" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 10, 2003 3:17 PM Subject: easy newbie REGEX > All, > I am really bad at REGEX's and am in need of help! > I have a script that asks for users input but I need to check that the input > begin with "MDS(and a number 0-9)" before proceeding > > below is something like what I am doing: > > print "ask for input"; > chomp ($answer=<STDIN>); > #(not sure which one to use below) > while/unless/if > $answer does not begin with "MDS[0-9] (and a number 0-9) > { keep asking for answer }; > > TYIA > > _________________________________________________________________ > Help STOP SPAM with the new MSN 8 and get 2 months FREE* > http://join.msn.com/?page=features/junkmail > > _______________________________________________ > Perl-Win32-Users mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs