my $logFile = IO::File->new("$someFile", 'a'); my $cmd = qx($rsh $host -l $id "$command"); print $logfile $cmd;