#!/usr/bin/expect -f
spawn telnet 10.123.9.111
expect login {send username\r}
expect password {send password\r}
----Here i want to execute commands----
----Commands are stored in an array in example.pl script----
----All variables are global in perl script----
----After executing these commands, control should again transfer to the called perl script----
我怎样才能做到?这是正确的方法吗?或者有什么更好的方法来做到这一点?