#!usr/bin/perl system("ssh remote"); chdir("/home/remote/test"); system("cp test.txt /home/remote"); system("./perl.pl"); system("exit");