print $expect_instance "$username}\r"; ( $which, $why, $match, $before, $after) = $expect_instance->expect( $timeout, 'Password:'); if( ! $which ) { myerror( 'send the password:'.$why );