in reply to Perlwanab grep array elemetns against another array
Another thing, you did not abide by the mantra which says:
This would be saving you a lot of debugging headaches, so you may want to pick up this habit urgently.use strict; use warnings;
Now, on to your code and changing:
to:while (<SOURCE>) { $script = <SOURCE>; 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.while(read(SOURCE, $script,1)){ #reading one byte at a time chomp $script; @line=grep( /$script/, @sfile ); }
|
|---|