in reply to Re: loop control
in thread loop control
open($syscmd,"ps -a |") || die "unable to open system command $!\n"; $count =0; while (<$syscmd>){ @list1 = split(" ", $_); @list[$count] = @list1[3]; $count = $count + 1; } $set = 0; foreach $val(sort keys(%prolist)){ #checks through every element +in the hash one by one. while(<@list>){ #looks through each element in list for a matc +h if ($prolist{$val} eq $_ ){ #if the match is found $set = 1; #sets this to true so that the below if sta +tment isn't executed last; } } if ($set == 0){ #prints only if there is no match print + "NF: $prolist{$val}\n"; } $set = 0; #resets boolen }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: loop control
by Anonymous Monk on Feb 04, 2003 at 22:04 UTC | |
|
Re (3): loop control
by VSarkiss (Monsignor) on Feb 04, 2003 at 16:59 UTC | |
by steves (Curate) on Feb 04, 2003 at 17:14 UTC | |
by VSarkiss (Monsignor) on Feb 04, 2003 at 17:34 UTC |