This is a FAQ. See perlfaq4 on How do I compute the difference of two arrays?
In reply to Re: partial matching of lines in perl by Corion in thread partial matching of lines in perl by Sidd@786