my @cmd = ('ssh', '-x', 'user@remotehost', '"ls -la > mylsfile"'); my @output = qx/@cmd/;