http://qs321.pair.com?node_id=317441

Tan has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

As someone who has started out on using Perl, I am faced with a problem which you may be able to recommend solutions to. It essentially requires pattern matching between two data files.

For example:

In file A i have the following fields of data:

(Name, A, B, C, D,) (ABB, A1, B1, C1 D1) (Accor ...) (Aflac Inc...)

etc... and in File B i may have data which will contain some of the above names although not strictly in the same order or description, e.g.

(Name A, B, C, D) (Abb A11, B11, C11, D11) (Accor-plc ...) (Aflac-Inc...)

Ideally I need to search for these names and copy over the field entries for A B C D from one data file to another.

Can perl do "sounds like" pattern searching and then copy the contents of the array?

Cheers.

Edited by Chady -- fixed formatting.