Hi Monks
Its been a while since i was on here but could do with some help.
I would like to rename the file extensions of all the files listed in an array from ".tst" to ".test" I would also like to send the output to a file. I have done this before but this time I can’t see what I’m doing wrong. Please help!
:-)
I get the following error - Can't modify constant item in list assignment at testscript line 23, near ");"
Execution of ediorder aborted due to compilation errors (#1)
my %ext_map = ( '.tst' => '.test' );
open(FHA, ">renamebatch");
foreach my $file (@orderlist) {
(old_filename, undef, $ext) = fileparse($file,qr{\..*});
my $new_ext = $ext_map{$ext} || $ext;
my $new_filename = $old_filename;
print(FHA "$new_filename$new_ext");
}