Can't cd to (./test/) test test test test: No such file or directory at e:\path\myfiles\perl\filename_spaces2.pl line 7 #### #Perl should find spaces and replace them with "-" # use warnings; use File::Copy; use File::Find; find(\&rename_txts, "."); #Pfade ... find(\&rename_txts, "./txt2/"); sub rename_txts { if (!/^\.+$/) { my $new_name = $_; $new_name =~ y/ /-/; print "$File::Find::name to $new_name\n"; print "$_ \n"; move $_, $new_name; } }