There's more than one way to do things | |
PerlMonks |
How to campare two variable consist line and print differenceby Mjpaddy (Acolyte) |
on Sep 15, 2014 at 06:00 UTC ( [id://1100557]=perlquestion: print w/replies, xml ) | Need Help?? |
Mjpaddy has asked for the wisdom of the Perl Monks concerning the following question: Hi monksHow to compare two variables which has values a line and print the specific unmatched word by its position and line number for example
In the $str2 dont have "doesn't" as compare to $str1 So the output will be in other file called error.txt in this format: Line 1:cols 24 'doesn't' is missing from $str2 I have tried some modules in perl like: File::Compare, Text::Compare, List::Compare but they are not giving the proper answer. Which strategy should I choose to get multiple lines store in two variables like a two whole file is store in two different variable and compare 2nd file on 1st and print position of mismatch in other file. Please Help!Thanks in advance
Back to
Seekers of Perl Wisdom
|
|