That's a quoting issue: you have '...' around the entire perl command which you pass to ssh, and also '...' around the -e one liner - that's not going to work. Oh, and this has nothing to do with perl, but everything with the shell.
You could try another quoting character, like ", and escape things where necessary.