#!perl use strict; use warnings; use Time::Local; use Net::CLI; # Create the object instance for Telnet $cli = new Net::CLI('TELNET'); $NAME = "BSC14"; # Connect to host $cli->connect('HOSTNAME'); # Perform login $cli->login( Username => $USERNAME, Password => $PASSWORD, ); $cli->SearchAndExec('Windows NT Domain:'); $cli->print('\n'); $cli->system('C:\WINNT\Profiles\PATHNAME OF BSC>'); # Send a command and read the resulting output $output = $cli->cmd("mml"); print $output; $cli->print('\n'); $cli->cmd("allip;"); open ALLIP,">c:\\mm1\\log\\$NAME.txt"; @output = $cli->system('/<$/i'); $cli->cmd("exit"); $cli->system('C:\WINNT\Profiles\PATHNAME OF BSC>'); $cli->cmd("exit"); print ALLIP "$NAME\t"; print ALLIP @output; close(ALLIP); $cli->disconnect;