Re: Case insensitive file open in Perl

Bruce Bales <[email protected]>
Newsgroups gmane.org.user-groups.aclug.discussion
Message-ID <[email protected]>
On Monday 02 November 2009 19:50:00 Nate Bargmann wrote:
> Maybe I'm just braindead tonight (likely as it seems as though I've not
> adjusted to the time change yet).
>
> I'm working on a program that will load a user supplied file.  Since
> the file will be downloaded from the Web, it's possible that it will be
> all upper case, all lower, or a mixture.  Nice, huh?
>
> I'm trying to recall how one goes about doing a case insensitive search
> for the filename.  I know that I can use the //i matching operator.
> Would a foreach loop and passing each glob by the /filename.ext/i match
> be the way to go?
>
> Thanks!
>
> - Nate >>

How about "locate -i filename" ?

cat filename | tr "[:upper:]" "[:lower:]" will make the whole file lower case.

bruce
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.