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


in reply to Please find out the mistake in substitution function in the code??

Your print OUT if (...) needs something to print.

You should work out how you would do this manually in order to form your algorithm. I would suggest building a hash where the values from file2 are the keys, and the corresponding strings from file3 are the values. Then, for each line in file1, loop over the hash keys and replace with hash value if key is found in line.

Dum Spiro Spero