I want to write the following bash script to perl
#write out current crontab
crontab -l > mycron
#echo new cron into cron file
echo "00 09 * * 1-5 echo hello" >> mycron
#install new cron file
crontab mycron
rm mycron
In perl, when I convert to
my $cronjobs = `crontab -l`;
my $raw = "00 09 * * 1-5 echo hello";
$cronjobs .= $raw;
say `crontab $cronjobs`;
but the above perl doesn't work. why ?