Hello all,
I've used the "real" expect for a number of years, and now find myself
having to do some stuff w/ perl-expect.
Is there a way to capture text w/ () in the expect of perl like you can
w/ expect?
For example the following bit of expect code will grab the hostname of
the device you've logged into and store it in a variable called hostname:
expect {
-re "\n+(.*}>"
}
set hostname $expect_out(1,string)
The $expect_out(1,string) grabs what is inside the () in the expect
statement. Like a backrefrence \1 in a regexp.
Is there a way to do the same thing w/ perl expect?
Thanks in advance.
Sean
|