Alex,

Give this a try:

while ($answer !~ /^MDS\d/)
{
    print "ask for input ";
    chomp ($answer = <STDIN>);
}
print "$answer\n";

Hope it helps.

Dave Kazatsky
Senior Middleware Administrator
W. (908) 575-6947
C. (973) 865-8106
----- Forwarded by Dave Kazatsky/Bsg/MetLife/US on 06/10/2003 03:43 PM
-----
|---------+----------------------------------------------->
|         |           "alex p" <[EMAIL PROTECTED]>       |
|         |           Sent by:                            |
|         |           [EMAIL PROTECTED]|
|         |           veState.com                         |
|         |                                               |
|         |                                               |
|         |           06/10/2003 03:17 PM                 |
|         |                                               |
|---------+----------------------------------------------->
  
>----------------------------------------------------------------------------------------------|
  |                                                                                    
          |
  |       To:       [EMAIL PROTECTED]                                    |
  |       cc:                                                                          
          |
  |       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






The information contained in this message may be CONFIDENTIAL and is for the intended 
addressee only.  Any unauthorized use, dissemination of the information, or copying of 
this message is prohibited.  If you are not the intended addressee, please notify the 
sender immediately and delete this message.


_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to