in reply to Net::Telnet waitfor loop

It would be nice if you told us what you're getting in NVFILE. (Obligatory suggestions to use strict, warnings, and 3-argument open here). Offhand, two things I could suggest are that you might be running afoul of the timeout (which is set by default in Net::Telnet) or that you aren't for whatever reason, matching. Have you used dump_log() to see what's coming through?

Replies are listed 'Best First'.
Re^2: Net::Telnet waitfor loop
by sonicscott9041 (Novice) on Aug 20, 2009 at 16:27 UTC
    Sorry for the delay in updating. To many 'must be done now' issues. Currently I am getting nothing in the NVFILE (zero byte file). If I wasn't trying to loop, I can get the first page of the on-screen report. I am using strict & warnings - I will check on the three arg open. I have not yet used the dump log feature on this. I also suspect that it is timing out.
      Dump_log and Input_log both show that I am getting the first page of the on-screen report. It indeed IS dying on the until line. Here is the updated code:
      until ($t->waitfor('/REPORT FINISHED/') == 1) { ($op1) = $t->waitfor('/PAGE/'); print NVFILE $op1; ($op2) = waitfor('/PRESS RETURN/'); print NVFILE $op2; $t->print(""); }
      Thanks!

        Hmm...maybe your $t->output_record_separator() is set to something weird? (or, in any event, something inconsistent with what the machine at the other end is expecting)

        I'm having trouble coming up with other explanations. If it doesn't time out, and it doesn't fail to match, it ought to be sending the \n across the wire when prompted unless the ORS is fouled up. I'm not sure why you broke up the match into two pieces here, but I don't think that should matter.