my $CMD = "ssh me\@server1" ; my @args = qw( "cd /directory tar cf - " | tar xfv -) ; system("$CMD @args") == 0 or die "tar failed: $?" ;