in reply to Cannot Copy and Rename file

I think your problem is here:

my $newname = rename($file, $mrn);

"rename" returns a "true" or "false" based upon success.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.