in reply to Error: sh: -c: line 0: unexpected EOF while looking for matching `''

I suspect you have a quote in the value of $File::Find::name. The following could be used to generate the shell literal (instead of "'$File::Find::$name'"):
sub to_sh_literal { my ($s) = @_; # Assuming bourne shell. $s =~ s/'/'\\''/g; $s = "'$s'"; return $s; }

But why are you using grep (the external tool) at all?

Update: Removed encode since file names are bytes, not text.