Perl/ExifTool Script not Running

I'm trying to get a Perl script to work within Hazel. I am calling ExifTool to help with this function. When I run this command in terminal, it works as expected, but when running through Hazel, it does not. The process checks each file in the directory the JPG is located to see if there is a RAW file with the same name, and if so, the JPG is moved into a "JPEG Backup" folder.
I think the issue is that the function errors on each file that does not match. In terminal, I can just ignore these errors, but Hazel may not finish the script because of the errors. I tried using "exit 0;" to force the script to run, but that doesn't help. Here is the code I am running and a screenshot of the setup within Hazel.
Any assistance is much appreciated.

I think the issue is that the function errors on each file that does not match. In terminal, I can just ignore these errors, but Hazel may not finish the script because of the errors. I tried using "exit 0;" to force the script to run, but that doesn't help. Here is the code I am running and a screenshot of the setup within Hazel.
Any assistance is much appreciated.
- Code: Select all
my $path = $1;
$path =~ s{/\d{4}-\d{2}-\d{2} __ \d{2}.\d{2}.\d{2} __ \w+ __ \w+\.\w{3}$}{};
exec("/usr/local/bin/exiftool --ext jpg -directory=\"%dJPEG Backup\" -srcfile %d%f.jpg \"$path\"");
exit 0;