This is dead simple in PHP but I'm doing a small script in perl, and simple perl
The grep doesn't seem to be working. Any ideas?
Code:
#I have 2 arrays with very similar content
#@pids
#@outs
#I need to know which values don't exist in the other array
print "Orphaned Processes\n";
foreach $pid (@pids){
#$found = grep/$pid/@outs;
$found = grep(/$pid/, @outs);
if ($found > 0)
{
print "proc: $pid\n";
}
}
print "Orphaned Out Files\n";
foreach $thisout (@outs){
$found = grep(/$thisout/, @pids);
if ($found > 0)
{
print "$thisout\n";
}
}
thanks
SarahMore:


LinkBack URL
About LinkBacks
Reply With Quote

























































Bookmarks