How to use Secure Shell (SSH) to pass results back to invoking machine

Hi,

I am running a script from a client machine X which does "SSH" to around 100 other machines in a farm and invokes a local script on each of those machines. Local script localscript.sh on each of those 100 target machines, does some machine specific function like fetch the specific machine's hardware information . The command I am running on the CLIENT machine which invokes localscript.sh on each of the 100 target machines is as follows:

REMOTE_COMMAND=. /path/localscript.sh
/usr/bin/ssh -n username@machinename $REMOTE_COMMAND

As far as the local script , just printing its computed values to std out, everything works fine. But I would like to know if there is a way this local script on each of the 100 machines can pass the results back to the client machine which is doing "SSH" onto all those machines.
The client machine would need to use these computed values from each of the 100 machines for some other global calculations.

Please help.

thanks
waavman

Never mind. I figured out a way of doing this by making this a system call from within a Perl script on the client machine

#!/usr/local/bin/perl -w

my $REMOTE_COMMAND=. /path/localscript.sh;
my $result=qx(/usr/bin/ssh -n username\@machinename $REMOTE_COMMAND);
printf("system call exited with $? status\n");

$result variable would now contain whatever computed values locascript.sh prints to stdout.

thanks
waavman