in reply to Safely close TELNET connection?

You should be able to use Net::Telnet. The following should connect, grab all available lines of data and print them to STDOUT before it exits. I say should because I have no way of testing it. You may need to uncomment and modify the regex in one of the commented out lines. Be sure to change the path in the Dump_log line and use tail -f to see what's going on.

#!/usr/bin/env perl use Net::Telnet (); my $telnet = new Net::Telnet( Timeout => 10, # Prompt => '/bash\$ $/', # Change me Errmode => 'die', Dump_log => '/path/to/dump.log', # change the path to a valid one ); $telnet->open('192.168.1.88'); #$telnet->waitfor('/bash\$ $/'); # Change me my @lines = $telnet->getlines(); $telnet->close(); print @lines; exit;