----- Original Message ----- From: "Luinrandir Hernson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, January 19, 2002 7:20 PM Subject: Re: help!!!trying to match password
so don't use the m/ and use a \b on both sides of "bob" in this case... I will research this further to understand. is there a name for this situation??? \b \b stands for border, therefore if you wish to match only the word bob, you could use if ($password =~m/\bbob\b/) { ...# do your things ......} m/ <=== is an optional thing, and is used if you need a 'delimiter' like m<bob> or m(bob). and you could also omit the m/ ... like this:- if ($password =~/\bbob\b/) { ...# do your things ......} ---- end of msg -------- thanks..lou ----- Original Message ----- From: Leon To: [EMAIL PROTECTED] Sent: Sunday, January 20, 2002 2:31 PM Subject: Re: help!!!trying to match password Like what Jeff says, use eq would be a better option. You may wish to know that "$password =~m/bob/" matches any of these :- anybob bobby anybobbie ... i.e so long as it sees a bob, it match. If you wish to match only bob and not bobby or abobby, then you may have to use border like this ~/\bbob\b/ ---- end of msg ---- ----- Original Message ----- From: "Luinrandir Hernson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, January 19, 2002 6:41 PM Subject: help!!!trying to match password I have managed to get this far. I've stripped down read(STDIN,$buffer,$ENV{'CONTENT_LENGTH'}); to the actual input, in this case bob and it works.... but so does bob123 , bobbies and bobs_a_bum etc... Just how do I match the input exactly bob to just bob ??????? thanks in advance code below if ($password =~m/bob/) { wholesale() } else { badpassword() }