Hong Wang wrote:

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

That should work - you could anchor it to the end to be safer:

        if ($file !~ /\.doc$/i) {       # the /i would ignore case also

-- 
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (Free site for Perl/Lakers)

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

Reply via email to