Help for this page

Select Code to Download


  1. or download this
    my $exp = Expect->spawn("telnet 192.168.1.150")
        or die "Cannot spawn telnet: $!\n";;
    my ($username,$password,$timeout);
    ...
                   ],
                   '-re', qr'[#>:] $', #' wait for shell prompt, then exit
    + expect
                  );
    
  2. or download this
    [root@localhost Perl_Ping]# perl telnet.pl
    Mon Aug 26 11:48:21 2013
    ...
    Escape character is '^]'.
    
    User name: [root@localhost Perl_Ping]#