Just an update, I had a go with String::Approx module in perl and it seems to be getting there. Here is the code
use String::Approx 'amatch';
open (DICT,"first.txt") or die "Can't open dict: $!";
open (PAT,"second.txt") or die "Can't open pattern: $!";
I am learning to program in perl, any suggestions to improve are welcome
Thanks for the reply jpollard. I haven't tried using diff yet. I will see how it works.