Case-insensitive match for File::Find

P

Prabh

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
 
J

Jürgen Exner

Prabh said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top