http://www.perlmonks.org?node_id=429708


in reply to Re: case insensitive filename matching
in thread case insensitive filename matching

$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

Replies are listed 'Best First'.
Re^3: case insensitive filename matching
by cog (Parson) on Feb 10, 2005 at 13:45 UTC
    Yes, you're right :-)

    (what was I thinking? :-) )