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') {
In reply to Re^2: Searching for Certain Values
by ikegami
in thread Searching for Certain Values
by Dr.Avocado
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |