Created
June 13, 2010 19:04
-
-
Save sinkovsky/436899 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use File::Find; | |
| use File::Copy; | |
| use Cwd; | |
| my $workdir = getcwd; | |
| find(sub { | |
| return if -d; | |
| return if -l; | |
| return if /^\./; | |
| print $_,"\n"; | |
| if ( my ($name) = $_ =~ /([^\-]+)-\w{4}.wav/ ) { | |
| my $old = $workdir."/".$File::Find::name; | |
| my $new = $workdir."/".$File::Find::dir."/".$name.".wav"; | |
| print "Renaming ", $old, "-> ", $new,"\n"; | |
| move $old, $new or die "Can't rename, $!"; | |
| } | |
| }, "foobar"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment