I am trying to run a simple script that will copy existing files and append with a date stamp. I want to keep the original (why I am not using 'move').

If I run the script with an extension, it works, if I try to pass a scalar value, it does not. (takes scalar as literal). The first file copies as file1.archive while the second file copies as file2.$now_string

Code with both examples:

Code

#!/usr/bin/perl use warnings; use strict; use File::Copy; use POSIX qw(strftime);