I need to send a command to UNIX that copies a log file and renames it with a variable in my Perl program. I know how to send commands to UNIX:
print `cp x.txt y.txt';
which works fine...but if I have the variable a to rename the file with:
print `cp x.txt $a_log.txt`
the error message comes up when I run the Perl script dbi:
Name "main::a_log" used only once: possible typo at dbi line 146.
Use of uninitialized value in concatenation (.) or string at dbi line
+146.
Any suggestions for using perl variables to rename a file with UNIX commands? I've also looked into the system() and exec() commands but have not come up with anything that works.