#!perl -w use strict; use Net::Telnet; # Hostinfos my $host = '10.0.0.1'; # Anmeldeinfos my $username = 'user'; my $password = 'password'; #my $obj = new Net::Telnet ($host); my $obj = new Net::Telnet (Host => $host, Timeout => 10, Input_log => "input.log", Dump_log => "dump.log", Timeout => "5", Prompt => '/[\$%#>] $/'); my $ok = $obj->login($username, $password); print "Login OK\n" if ($ok =~ /1/); my $string = 'show ver'; $ok = $obj->cmd(String => $string); $obj->print("\n"); print "weiter gehts\n"; while (my $line = $obj->getline()) { last unless $line; print "$line\n"; if ($line =~ /More/i) { print "More gefunden\n"; $obj->print("\n"); } print $line; last if $line =~ /#/; } $ok = $obj->close; exit;