Folks,
I am trying to understand the Expect.pm version of interact().
I have a telnet automation program written in tcl/expect that I am converting
to perl so that I can learn Expect.pm. The tcl version can telnet to a variety
of remote hosts, log in, handle any host-specific settings and then hand
control back to the user via interact:
send_user "$Prog: Handing control back to user on ${host}...\n";
interact {
"~~r" { send "tput rmso; clear\r" }
}
This fragment does two nice things,
1) it looks for the "~~r" string from the user and responds to it and then
continues interacting, and
2) as soon as the spawned process exits, the interact loop ends.
I cannot start to get the equivalent functionality in the perl interact, ie:
print "$prog: Handing control back to the user on $host...\n";
$Expect::Log_Stdout=1;
$telnet->interact(\*STDIN, "~~r");
Am I doing something wrong?
Regards,
Simon Taylor
--
(+613 9568 2005)
Unisolve Pty Ltd
Melbourne, Australia
|