unix code inside perl

This is the code:

#!/usr/bin/perl -w
$dir="/vol.nas/rpas_qc/mohima/Test/translations";
$dir1="/vol.nas/rpas_qc/mohima/Test/dest";
`find $dir -type f -exec rsync -a {} $dir1`;

This line:

find $dir -type f -exec rsync -a {} $dir1

works fine in Unix but I am getting an error in perl:

Can't find string terminator "`" anywhere before EOF at test1.pl line 4

I am trying to copy all files in $dir to $dir1 without the subdirectories.
Using perl since the script will do lot of other stuff which is easier in perl.
Any help is appreciated.


Source: unix

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.