Re: using 'negative look-ahead' assertions

2006-07-22 Thread Dr.Ruud
[EMAIL PROTECTED] schreef: > I'm trying to get all files of a directory whose name does not end > with a particular string. Start with a -f test, to ignore directories. -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EM

Re: using 'negative look-ahead' assertions

2006-07-21 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > I'm trying to get all files of a directory whose name does not end with a > particular string. > > I'm tried using: > @files = readdir DIR; > @otherfiles = grep /(?!java)/, @files; my @otherfiles = grep !/java\z/, @files; > but files with java in them are returned al

RE: using 'negative look-ahead' assertions

2006-07-21 Thread Timothy Johnson
If you really just want everything that doesn't match, do it like this: if($string !~ /pattern/){ do something... } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, July 21, 2006 5:52 PM To: beginners@perl.org Subject: using 'neg

using 'negative look-ahead' assertions

2006-07-21 Thread Jhst463
I'm trying to get all files of a directory whose name does not end with a particular string. I'm tried using: @files = readdir DIR; @otherfiles = grep /(?!java)/, @files; but files with java in them are returned along with the other files. I'd like to know, in general, how to get everything tha