in reply to Renaming Files
I like to make that of further use without having to edit the source each time, so I added a bit at it:
print 'Enter folder for renaming: '; chomp(my $dir=<STDIN>); print 'rename from *.'; chomp(my $from=<STDIN>); print 'rename to *.'; chomp(my $to=<STDIN>); $dir .= '/' unless ($dir =~ /[\/]$/); while (<$dir*.$from>) { my ($old,$new); $old = $new = $_; $new =~ s/$from$/$to/; rename $old, $new; }
|
|---|