Actually, this has nothing to do with ssh either... it's just a Unix problem. You are trying to redirect the output of cat into a directory. If you copied the file, cp would know the input file name and could use it to create the output file. Redirection with ">" doesn't do that... you have to tell it the name of the file explicitly. I think you can just change:
cat > /users/merc/tmp
to
cat > /users/merc/tmp/pars_rem.pl
---
By the way... why are you chmod'ing /users/sword/tmp just before you execute it? Did you mean /users/merc/tmp?
Also, if you want to remove the pars_rem.pl you need to put the command in,
rm /users/merc/tmp/pars_rem.pl
Hmm... you have the same file name on both systems... remember to back up the file to a different name in case the rm ever gets executed on the wrong one. Even better, change the name on one system or the other.
Another, possibly simpler, approach would be to just have perl execute its own standard input, so you don't need to use a temporary file at all,
perl -w -
|