in reply to Re: Searching for Certain Values
in thread Searching for Certain Values
if($name =~ /(intrepid|triumph)/) {
Captures are needlessly slow, and you're not actually checking for equality. Better:
if($name =~ /^(?:intrepid|triumph)\z/) {
And if you're so worried about speed, I think doing string comparisons would be even faster.
if($name eq 'intrepid' || $name eq 'triumph') {
|
|---|