http://www.perlmonks.org?node_id=198468

Elgon has asked for the wisdom of the Perl Monks concerning the following question:

Yet another daft question from Elgon,

I am rewriting my Texas Hold'ems Tool as an object oriented module and I'm trying to increase the fluency of the code. Thanks to kschwab, John M. Dlugosz, ignatz and others for help so far. The problem I am currently working on is how to reduce out one of the patterns which matches to the list of values of the cards. At the moment I have:

# Now for unsuited straights (not too difficult... if ( $sorted_values eq 'abcde' or $sorted_values eq 'bcdef' or $sorted_values eq 'cdefg' or $sorted_values eq 'defgh' or $sorted_values eq 'efghi' or $sorted_values eq 'fghij' or $sorted_values eq 'ghijk' or $sorted_values eq 'hijkl' or $sorted_values eq 'ijklm') { # do stuff... }
but what I'd really like to say is something like...
if ($sorted_values =~ m/INSERT_PATTERN_HERE/) { # Do stuff... }

I've tried reading the Chapter on regexps and pattern matching in the Blue Camel but I'm not really making any progress. In essence I'm trying to match all combinations of characters where they form a contiguous sequence (I have thought about doing this using the return values from ord() but decided that this would be inelegant.)

Can anyone give me some pointers please?

Elgon

"Rule #17 of Travel: Never try and score dope off Hassidic Jews while under the impression that they are Rastafarians."
       - Pete McCarthy, McCarthy's Bar