opendir (DIR, "/home/costas/test") or die "cannot opendir dir"; foreach $file (readdir(DIR)) { rename($file, lc($file)); #### my $path = '/home/costas/test'; opendir (DIR, $path) or die "Can't opendir: $!"; for (readdir DIR) { rename("$path/$_", "$path/" . lc); } closedir DIR;