Next Tricks of the Wizards 210

Matching Many Patterns at Once

        for ($i=0; $i < @state_pat; $i++) {
          return $state_abbr[$i]
            if $input =~ /$state_pat[$i]/;
        }
        return;


Next Copyright © 2003 M. J. Dominus