in reply to Re: Re: What's the best way to do a pattern search like this?
in thread What's the best way to do a pattern search like this?

You just need to adjust the regex a little.

my @array_codes = split /\s+/, <FILE>;

assumes that you're interested in all non-whitespace characters. Changing it to:

my @array_codes = split /\W+/, <FILE>;

means that your're only interested in non-word characters (where word chars are A-Z, 0-9 and '-').

--
<http://www.dave.org.uk>

Perl Training in the UK <http://www.iterative-software.com>