in reply to Pattern Matching Query
Update: As others have suggested in the full thread there are more elegant ways to do this.use warnings; use strict; my $hand = 'defgh'; my @tests = ( qr/abcde/, qr/bcdef/, qr/cdefg/, qr/defgh/, ); for my $test (@tests) { if ($hand =~ /$test/) { # do stuff # print "Got a straight\n"; } }
--
May the Source be with you.You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.
|
|---|