RE:Re: grep utility

2001-09-17 Thread Brett W. McCoy
On Tue, 18 Sep 2001, Teresa Raymond wrote: > Just wondering about the exclamation mark here: > > > > @UNLOCKED = grep(!/LOCKED/g, @SAME); > > Would this be equivalent to using !~/LOCKED/g ? The ! is negating the regular expression's boolean value -- if the regular expression matches, it returns

RE:Re: grep utility

2001-09-17 Thread Teresa Raymond
Just wondering about the exclamation mark here: > > @UNLOCKED = grep(!/LOCKED/g, @SAME); Would this be equivalent to using !~/LOCKED/g ? --- - Teresa Raymond - - [EMAIL PROTECTED] - - http://www.mariposanet.com - --- --

Re: grep utility

2001-09-14 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (John_kennedy) wrote: > Is this line correct: > @UNLOCKED = grep(!/LOCKED/g, @SAME); you could just as well say @UNLOCKED = grep( !/LOCKED/, @SAME); since you only need to find the string once. > print BOTH @SAME; > print oBOTH @UNLOCKED

grep utility

2001-09-14 Thread John_Kennedy
Is this line correct: @UNLOCKED = grep(!/LOCKED/g, @SAME); I want it to check each line of the array @SAME and print lines that DO NOT contain the string "LOCKED" to the array @UNLOCKED. I later output both arrays to different files: print BOTH @SAME; print oBOTH @UNLOCKED; but when I list the