in reply to case insensitive filename matching

Get the list of all files in the filesystem, get the list of the files you want, and use grep:

grep { is_in(@mylist) } @files_in_the_filesystem

That'll give you the list of files you want (hopefully).

Of course, you'll have to code the is_in subroutine, which will probably contain a bit of code like this:

$newfile =~ /^$oldfile$/i

I hope that sets you in the right direction. Honk if you need more help :-)

Replies are listed 'Best First'.
Re^2: case insensitive filename matching
by edan (Curate) on Feb 10, 2005 at 13:37 UTC

    $newfile =~ /^$oldfile$/i

    As much as I like regexps, I would be much more likely to write that as:

    if ( lc $newfile eq lc $oldfile )

    In my eyes, that's the canonical case-insensitive equality comparision.

    --
    edan

      Yes, you're right :-)

      (what was I thinking? :-) )