Efficient fuzzy matching in Perl