http://www.perlmonks.org?node_id=1102944


in reply to Re: Searching for best match
in thread Searching for best match

Thank you! Yes the best match is the longest one. In the Stackoverflow post someone suggested that I looked into fuzzy-matching modules. I'm also looking into this.

Replies are listed 'Best First'.
Re^3: Searching for best match
by Anonymous Monk on Oct 06, 2014 at 15:39 UTC

    It's a little unclear to me if Text::Fuzzy does what you want, but of course investigating CPAN modules is a good idea.

    Also, just a note that the code above is only an interpretation if what your original code appears to want to do, i.e. looking at only the first two names for matches.

    A more complete selection of sample input, description of what you want the match to be, and sample output would really help, I think.