title: Why does my Net::Telnet program timeout?
body: <p>I'm written small code to  connect to remote server using Perl but observing error messages</p>
  
  <pre><code>#!/usr/bin/perl -w
  
  use Net::Telnet;
  
  $telnet = new Net::Telnet ( Timeout=&gt;60, Errmode=&gt;'die');
  
  $telnet-&gt;open('192.168.50.40');
  
  $telnet-&gt;waitfor('/login:/');
  
  $telnet-&gt;print('queen');
  
  $telnet-&gt;waitfor('/password:/');
  
  $telnet-&gt;print('kinG!');
  
  $telnet-&gt;waitfor('/:/');
  
  $telnet-&gt;print('vol &gt;&gt; C:\result.txt');
  
  $telnet-&gt;waitfor('/:/');
  
  $telnet-&gt;cmd("mkdir vol");
  
  $telnet-&gt;print('mkdir vol234');
  
  $telnet-&gt;cmd("mkdir vol1");
  
  $telnet-&gt;waitfor('/\$ $/i'); 
  
  $telnet-&gt;print('whoamI');
  
  print $output;
  </code></pre>
  
  <p>But while running i'm getting following errors</p>
  
  <pre><code>C:\&gt;perl -c E:\test\net.pl
  
  E:\test\net.pl syntax OK
  
  C:\&gt;perl E:\test\net.pl
  
  command timed-out at E:\test\net.pl line 13
  
  C:\&gt;
  </code></pre>
  
  <p>Help me in this regard. I'm new to Perl.</p>