in reply to Net::Telnet / file question

What command actually runs the report? It seems like the session output before 'Press any key to continue' is what you are trying to avoid. If so, simply avoid printing $op1 to your results file.

Replies are listed 'Best First'.
Re^2: Net::Telnet / file question
by sonicscott9041 (Novice) on Jul 21, 2009 at 19:32 UTC
    This is the area:
    $t->print("O"); ($op1) = $t->waitfor('/Press any key to continue/'); print nvfile $op1; $t->print("N"); ($op2) = $t->waitfor('/REPORT COMPLETE/'); print nvfile $op2;
    The print "O" (letter, not number) starts the report 'on-screen'. This prints the first screen of the report, then pauses with the 'Press any key to continue'. A human would basically look at the report one screen at a time (like the 'more' command on linux). However, by sending the print "N" command, it then runs the rest of report to the screen without any more of those 'Press any key to continue' messages. Thanks!
      Try doing a $t->waitfor for the prompt that you respond to with the "O" (letter, not number) input(just before the print). This will clear out the input stream up to the start of the report.
        Thanks! I had to add the additional waitfor statement you suggested AND one more to further clear out the input stream. Now for the next step ... extracting the information I need from the newly created file!