$exp->expect($timeout, [ qr/username: /i, sub { my $self = shift; $self->send("$username\r"); exp_continue; }], [ qr/password: /i, sub { my $self = shift; $self->send("$password\r"); exp_continue; }], $shell_prompt); #### print "username: "; my $username = ; print "password: "; my $password = ; chomp $username; chomp $password;