Hong,

Here a few untested examples, I have tried to skip shortcuts to make
things a little more clear.

my @FILELIST = @ARGV;

foreach $file (@FILELIST) {
        # Skip all files with .doc extention.
        next if ($file =~ m/\.doc$/);
        # do something.
}

OR

foreach $file (@FILELIST) {
        # Skip all files without .doc extention.
        next unless ($file =~ m/\.doc$/);
        #do something.
}

=+=+=+=+=+=+=+=+=+=+
James Schappet
Schappet.com


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Hong Wang
Sent: Monday, August 04, 2003 4:14 PM
To: [EMAIL PROTECTED]
Subject: [Perl-unix-users] match function

I like to check if file with .doc extension will be excluded. for
example, 
if file name is todo.doc:


How can I use match function? What I did is not working. What I tried:

if($file !~ /\.doc/)
{
    do something
}

or

if($file !~ /.doc/)



Thanks in advance!

Hong



_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to