in reply to Perlwanab grep array elemetns against another array

ikegami made justice to your question by providing a generous explanation, there are a couple of things I'd like to add, you haven't provided sample inputs of the type of data you wanted to run this script on with regard to SOURCE, FILE2SEARCH and DEST, you haven't shown how this data looks like and whether appending to DEST every time you run this script is acceptable because probably by then DEST would contain a lot of duplicates.

Another thing, you did not abide by the mantra which says:

use strict; use warnings;
This would be saving you a lot of debugging headaches, so you may want to pick up this habit urgently.

Now, on to your code and changing:

while (<SOURCE>) { $script = <SOURCE>; chomp $script; @line=grep( /$script/, @sfile ); }
to:
while(read(SOURCE, $script,1)){ #reading one byte at a time chomp $script; @line=grep( /$script/, @sfile ); }
made the script work as well, but I can't tell if it serves what you sought for lack of samples that should have been provided.

Excellence is an Endeavor of Persistence. Chance Favors a Prepared Mind.