try this..
__ START __
my $path = qq~$HOME/documents~; # set this to your path
opendir(DIR,$path) or diesub("can't readdir $path: $!"); # open the entire
directory for getting the contents of
while (my $file = readdir DIR) { # $file gets assigned the next value of
DIR, and exits when there's no more files
my ($fname,$ext) = split(/\./,$file); # removes extension
next if $file eq '.' or $file eq '..' or $ext ne 'html'; # goes to next
look if $file is . (current dir) or .. (parent dir)
rename $file, lc($file); # rename
}
closedir DIR; # close directory
__ END __
dan
P.S: This is untested.. test/alter/correct/test as need be.
"Desmond Coughlan" <[EMAIL PROTECTED]> wrote in message
news:20021103180226.GE15981@;lievre.voute.net...
Hi,
I'm trying to figure out how I can change the filenames in a directory, from
having an initial capital letter, to all lowercase. The files came from
a Windows system, which doesn't really care about case. My BSD box,
however,
does !
I've tried fiddling around with tr and lc, but I don't know perl enough
to get it to work. FYI, the directory is called $HOME/documents, and
the files are called 'Indexpage.html', or 'Reportback.html' and so on ...
Thanks in advance.
D.
--
Desmond Coughlan
[EMAIL PROTECTED]
http://www.zeouane.org
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]