#jumping into the relevent bits... $command->log_file(undef); if ($command->expect(2,"/>")){ $command->log_file("$TEMPFILE") or die; print $command "COMMAND\r"; } if ($command->expect(5,"/>")){ $command->log_file(undef); } open (LOG, "$TEMPFILE") or die; @command_results=; close LOG;