use File::Copy; opendir(DIR,$file); my @files = readdir(DIR); close(DIR); for my $file (@files) { if($file =~ /\.HTML?$/) { my $new_file = lc $file; move($file, $new_file) or die "Can't move file: $!"; } }
Update: Fixed incorrect Perl construct. Thanks to gav^ for noticing it.
--
Ilya Martynov
(http://martynov.org/)
In reply to Re: Changing filename extentions
by IlyaM
in thread Changing filename extentions
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |