while(read(SOURCE, $script,1)){ #reading one byte at a time chomp $script; @line=grep( /$script/, @sfile ); }