#!/usr/bin/perl my ($t, $op1, $op2); use Net::Telnet (); $t = new Net::Telnet; $t->open("192.168.1.1"); ## Open data file for writing open (nvfile, '>testout.txt'); ## Wait for first prompt and respond with 'era'. $t->waitfor('/login:/'); $t->print("era"); ## Wait for login prompt. $t->waitfor('/USER ID/'); $t->print("ANYUSER"); $t->print("ANYPASS"); ## Navigate to the report screen and select report to run. $t->waitfor('/SELECTION/'); $t->print("77"); $t->print("1"); $t->print("4"); $t->print("6910"); $t->print("?"); $t->print("10"); ## Run report On-screen and capture to file $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; $t->print(""); $t->print("END"); ## Logoff $t->waitfor('/SELECTION/'); $t->print("88"); $t->print("Y"); exit;