Be sure to look at String::Approx too.

A cool thing that hashes do not do, would be to allow a regex for a key.

I can't speak for earlier versions, but you can definitely use regexes as hash keys in 5.6.1:

use strict; my %tests = ( qr/^[0-9]+$/ => 'positive integer', qr/co/i => 'company/corporation', ); foreach my $term qw(12345 Company Jones) { foreach my $key (keys %tests) { print "$term is a $tests{$key}\n" if $term =~ $key; } }

        $perlmonks{seattlejohn} = 'John Clyman';


In reply to Re: text string approxiamtions (concept for review) by seattlejohn
in thread text string approxiamtions (concept for review) by shemp

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":