One thing you might consider is maybe using 'expect'. Rather than trying to remote run all of those ssh commands...at least that is what I do and it works fairly smoothly. Another thing I have done is written a series of information gathering scripts that run daily out of cron and then use a scp -B to grab them all and parse locally...

As to your problems, I am going to mess around for it a while and see if I can figure it out, but wanted to through 'expect' out there first...

/nebulus

Code:
$system = "testhost";
$ssh = "/bin/ssh";
$perl = "/bin/perl";

$cmd  = "perl -F: -ane 'print if \! \@F[2];' /etc/passwd";
$response = `$ssh $system \"$cmd\"`;
Worked...think you just needed to escape out the special characters (! and @).

/nebulus