in reply to perl -e in ssh

Look where your single quotes start and end in the second command. Completely different from the first command.