#!/perl/bin/perl -w use strict; # Open 'find' process to list files recursively with paths #my $path_to_dir = shift; print "Opening Directory\n"; my $path_to_dir = "c:/progra~1/apache~1/apache2/htdocs/test"; dir("$path_to_dir"); sub dir { opendir(DIR,"$_[0]"); my @list_of_files = readdir(DIR); foreach(@list_of_files) { print "BEFORE: $_\n"; if($_ ne "." && $_ ne "..") { if(-d "$_[0]/$_") { dir("$_[0]/$_"); } else { $_ =~ s/\ /_/ig; rename "$_[0]/$_","$_[0]/\L$_"; print "AFTER: $_[0]/$_,$_[0]/\L$_\n\n"; } } } } ##### print "\n\nDone!... ;-)";
In reply to Renaming Not Working by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |