I am new to perl.Below is my code to touch a directory using perl
#!/usr/bin/perl
# Populate the hashMap
# keys --> directories to clean
# attributes --> days to keep.
print "<-------------------------------------------------------->";
print " Touching of folders Started ";
touch `/tmp/dir1`;
touch `/tmp/dir2`;
print " Touching of folders Ended ";
print "<-------------------------------------------------------->";
Get the below syntax error when I run the script. Please help.
$ ./FeedServerHscript.sh
Backticks found where operator expected at /tmp/eCAS_Housekeep/Ecas_54.pl line 11, near "touch `/tmp/dir1`"
(Do you need to predeclare touch?)
Backticks found where operator expected at /tmp/eCAS_Housekeep/Ecas_54.pl line 12, near "touch `/tmp/dir2`"
(Do you need to predeclare touch?)
syntax error at /tmp/eCAS_Housekeep/Ecas_54.pl line 11, near "touch `/tmp/dir1`"
Execution of /tmp/eCAS_Housekeep/Ecas_54.pl aborted due to compilation errors.