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