Case-insensitive match for File::Find

Discussion in 'Perl Misc' started by Prabh, Feb 18, 2004.

  1. Prabh

    Prabh Guest

    Hello all,
    Just wanted to check if theres a 'case-insensitive' option while
    searching for an element using File::Find. I'm going through the
    module docs and cant see any mention to case-sensitivity.

    I know I need to search for "foo", but dont know if its present as
    "Foo" or "foo"....

    For now, I'm using this very time-consuming cmd-line Unix find.

    <%> find /home/abc123 | grep -i foo

    Thanks for your time,
    Prab
     
    Prabh, Feb 18, 2004
    #1
    1. Advertising

  2. Prabh wrote:
    > Just wanted to check if theres a 'case-insensitive' option while
    > searching for an element using File::Find. I'm going through the
    > module docs and cant see any mention to case-sensitivity.


    Well, the docs state that
    " The wanted() function does whatever verifications you want."

    So just write your wanted() function in such a way that it returns 1 iff the
    current file name matches the searched-for file name in whatever way you
    define "match".

    Show us the code for your wanted() function.
    Then we may be able to figure out why your code isn't working the way you
    expect it to work.

    jue
     
    Jürgen Exner, Feb 19, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tee
    Replies:
    3
    Views:
    7,905
    Herfried K. Wagner [MVP]
    Jun 23, 2004
  2. =?ISO-8859-1?Q?=22Nils_O=2E_Sel=E5sdal=22?=

    case insensitive string::find

    =?ISO-8859-1?Q?=22Nils_O=2E_Sel=E5sdal=22?=, Oct 19, 2004, in forum: C++
    Replies:
    5
    Views:
    16,807
    Siemel Naran
    Oct 20, 2004
  3. Johny
    Replies:
    11
    Views:
    714
    Steven D'Aprano
    Feb 8, 2007
  4. Replies:
    1
    Views:
    2,547
    Mark P
    Apr 6, 2007
  5. Xah Lee
    Replies:
    4
    Views:
    1,043
Loading...

Share This Page