Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: elseif syntax error
by jakobi (Pilgrim) on Oct 27, 2009 at 14:18 UTC | |
|
Re: elseif syntax error
by keszler (Priest) on Oct 27, 2009 at 14:29 UTC | |
by gmargo (Hermit) on Oct 27, 2009 at 14:44 UTC | |
by keszler (Priest) on Oct 27, 2009 at 14:55 UTC | |
by jakobi (Pilgrim) on Oct 27, 2009 at 15:02 UTC | |
by Anonymous Monk on Oct 27, 2009 at 15:20 UTC | |
by gmargo (Hermit) on Oct 27, 2009 at 16:07 UTC | |
|
Re: elseif syntax error
by GrandFather (Saint) on Oct 28, 2009 at 00:24 UTC | |
by schetchik (Beadle) on Oct 28, 2009 at 12:53 UTC | |
by GrandFather (Saint) on Oct 28, 2009 at 18:46 UTC | |
|
Re: elseif syntax error
by biohisham (Priest) on Oct 27, 2009 at 14:38 UTC | |
by wfsp (Abbot) on Oct 27, 2009 at 15:32 UTC |