|
|
| Think about Loose Coupling | |
| PerlMonks |
Re: Regex to compare (if) two strings (Uniquely - I will explain inside)by Kenosis (Deacon) |
| on Nov 24, 2012 at 18:29 UTC ( #1005411=note: print w/ replies, xml ) | Need Help?? |
|
Gotta validate the inputted word by checking that it indeed consists of the chars in $random_string. Perhaps I'm misunderstanding you, but this sounds like you want to validate that the two sets of string characters are equal (the 'compare uniquely')--not that the two strings are equal. If this is the case, the following is an option:
Hope this helps! Update: Replaced the hash solution with one using the smart operator (~~), as the former didn't match properly.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||