title: How to transfer control between scripts?
body: <pre><code>#!/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----
  </code></pre>
  
  <p>How can i make it ? Is this the right way ? Or any better ways to do this ?</p>