title: timed-out waiting for login prompt Telnet Perl
body: <p>I have a problem to log in into a telnet prompt using perl</p>
  
  <p>this is my prompt:</p>
  
  <pre><code>Trying 192.168.10.15...
  Connected to 192.168.10.15.
  Escape character is '^]'.
  
  Enter username and password
  &gt;
  </code></pre>
  
  <p>And this is my code:</p>
  
  <pre><code>use Net::Telnet ();
  $t = new Net::Telnet (Port =&gt; 11052, Timeout =&gt; 10, Prompt =&gt; '/Enter username and password/ /\n/ /&gt; $/i');
  $t-&gt;open("192.168.10.15");
  $t-&gt;login('test', 'test1');
  @lines = $t-&gt;cmd("ls");
  print @lines;
  </code></pre>
  
  <p>But I have a message error: timed-out waiting for login prompt </p>
  
  <p>I tried using:</p>
  
  <pre><code>$t-&gt;waitfor('/Enter username and password/ /\n/ /&gt; $/i');
  </code></pre>
  
  <p>and</p>
  
  <pre><code>$-&gt;waitfor('/&gt; $/i');
  </code></pre>
  
  <p>can anybody help me with this?</p>