-2
#!/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----
我該如何做到?這是正確的方式嗎?或者有更好的方法來做到這一點?如何在腳本之間傳輸控制?