The Elsif is not working i try to exclude the working directory "." from copying.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/ /-/; #Gives us the changed names: print "$File::Find::name to $new_name\n"; print "$_ \n"; #Try to exclude "." the current directory this is not working ... + elsif ($_ ne ".") { move $_, $new_name; } } }
In reply to elseif syntax error by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |