LAdProg2005
Programmer
I am going through documentation of expect and I came across somethings I do not understand if someone can please help me understand I will appreicate it.
In the below code what does shift signify, i do not understand what it is doing.
writing in below manner accomplishes the same result as above?
If i have gui that allows to input username how can i pass that username to the above code to accept the passed in value from gui? Any pointers will be helpful.
thanks
LAdProg
In the below code what does shift signify, i do not understand what it is doing.
Code:
$exp->expect($timeout,
[ qr/username: /i, sub { my $self = shift;
$self->send("$username\n");
exp_continue; }],
[ qr/password: /i, sub { my $self = shift;
$self->send("$password\n");
exp_continue; }],
$shell_prompt);
Code:
$newExpect = new Expect;
$newExpect->expect(5,"username:");
$exp->match();
$exp->send("string(tempUser)\n enter\n ");
thanks
LAdProg