This is a very simple way of changing all filenames within a directory to lowercase. I've seen some of the others who've posted something similar, but thought someone might could use this as well.
ls|perl -lne 'for($d=$_){y/A-Z/a-z/;};rename $_,$d unless -f $d;'

Replies are listed 'Best First'.
Re: Another lowercase one-liner
by merlyn (Sage) on Dec 27, 2001 at 19:43 UTC
    That messes up on filenames containing newlines. You're better off using even the shell's globbing:
    perl -e 'for (@ARGV) {for($d=$_){y/A-Z/a-z/;};rename $_,$d unless -f $ +d;}' *

    -- Randal L. Schwartz, Perl hacker

Re: Another lowercase one-liner
by robin (Chaplain) on Dec 28, 2001 at 00:46 UTC
    -f lc||rename($_,lc)||warn"$_: $!\n" for <*>
Re: Another lowercase one-liner
by japhy (Canon) on Dec 27, 2001 at 20:39 UTC
    Why don't you use lc() function instead? Or something like:
    ($d = $_) =~ y/A-Z/a-z/; $d = lc $_; $d = lc;

    _____________________________________________________
    Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
    s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Re: Another lowercase one-liner
by michairw (Initiate) on Dec 27, 2001 at 23:46 UTC
    Good idea! Thanks for the suggestion.