in reply to
Extract first word from certain lines in a file
I don't quite understand either, but it sounds like a Longuest Common Substring problem. I found
a thread
(seemingly) discussing LCS in depth.
Comment on
Re: Extract first word from certain lines in a file
In Section
Seekers of Perl Wisdom