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
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 -
---
--
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
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