I define two arrays - one is an active changing file ( @unix = ps -ef ) and
need to compare it to a static text file @static = `cat myfile`.
Would someone help me on the syntax of greping for @static matches in the
@unix array.
For example
#!/usr/bin/perl -w;
use strict;
my @unix = `ps -ef `;
my @static = `cat myfile`;
my @final = grep { @static} @unix;
print @final; <==== I am wanting this to return only the files in myfile
that match the @unix array.
I am not sure if I need to assign a variable, for loop etc with in the { }
to get the pattern matching results I need.
Thank you.