good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^2: partial matching of lines in perlby AnomalousMonk (Archbishop) |
on Jun 13, 2020 at 06:54 UTC ( [id://11118012]=note: print w/replies, xml ) | Need Help?? |
... the following code ... does not produce your expected output. Perhaps we misunderstand your requirement. I'm also confused about Sidd@786's expected output. I can see that 'he is man' from file1 should be output because it has 'he is' from file2 as an exact substring. But Sidd@786 also seems to be saying in the OP that 'what goes on' should also be output, and I don't see how that's possible given the (somewhat vaguely presented) data and my (similarly vague) understanding of the requirement. Perhaps Sidd@786 can clarify things for us. I have code solutions for both index-based and dynamic regex approaches, but I'm a bit reluctant to post because the OP has too strong a smell of homework about it. Perhaps I'll post them tomorrow. Give a man a fish: <%-{-{-{-<
In Section
Seekers of Perl Wisdom
|
|