in reply to Not renaming/moving files

Try checking if the rename passed, and display an error message if it failed:
rename("$oldpath", "$newpath") or die "Error: $!";
Typically, the old file does not exist, or the new file can not be created because permissions are not set properly.

Update: and try to chomp your $record.

use strict; use warnings; open my $fh, '<', "c:\\temp\\work.txt" or die "can not open file: $!"; while (my $record = <$fh>) { chomp $record; my $oldpath = "c:\\olddir\\$record"; my $newpath = "c:\\newdir\\$record"; rename $oldpath => $newpath or die "Error: $!"; } close $fh;