what is wrong with this line?

system ("$ssh '$perf_stats' < temp_pipe 2>&1 &");

I need to start and interact with my executable defined by perf_stats on a remote machine but not change my command line to that of the remote machine. temp_pipe is a node created by mknod -f temp_pipe

I assume $ssh contains the command your trying to run..

I have had problems with putting the var right in the system command.

I usually do this:

$mycommand = "somecommand";
#next line lets you verify the command is correct
print "Running Command: $cmd \n";
$cmd = "$mycommand $othervars < $whatever";

system($cmd);

or

$rtn = `$cmd`;

$ssh contains the command that connects the client with the remote host.
system ("$ssh '$perf_stats' < temp_pipe 2>&1 &");

I then use something like this:
system("$rsh '$cmd'" );

where $rsh is the rsh connection command and $cmd is the command I use to run on $perf_stats.

Aren't you missing the destination host names?

the $rsh, $ssh contains that. for instance,
$ssh="ssh $USER@$HOST";

The @ symbol must be escaped in a double-quoted string unless you want perl to think it is an array and expand it into a scalar.

$ssh="ssh $USER\@$HOST";

The @ symbol must be escaped in a double-quoted string unless you want perl to think it is an array and expand it into a scalar.

$ssh="ssh $USER\@$HOST";