ThomasAllenDE has asked for the wisdom of the Perl Monks concerning the following question:
Greetings - I am not a Perl expert and am seeking Perl advice.
I am writing a script which looks through a directory and finds entries which are similar.
In the directory there may be entries for Oracle11*, Oracle10*, Office2003, Office2001, Offer, Groovy.
The question is, how do a take the string "Office2003", regard each letter separately, and then match letter for letter until a particular number of matching letters is reached, so I can say then names are similar?
For example, if the first 3 letters match, then Offer matches Office. But if I say "match" only when the first 6 letters match, then Office2001 matches Office2003, but not Offer
You help is very appreciated!
Thanks! - Tom
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Identifying Files with Similar Names
by Ratazong (Monsignor) on Mar 07, 2012 at 11:47 UTC | |
|
Re: Identifying Files with Similar Names
by JavaFan (Canon) on Mar 07, 2012 at 11:34 UTC | |
|
Re: Identifying Files with Similar Names
by nemesdani (Friar) on Mar 07, 2012 at 11:06 UTC |