title: Telnetting with Perl to OLT MA5608T
body: <p>I need help with Net:Telnet. Trying to connect to Huawei OLT M5608 terminal. When using normal telnet from console it works fine. I can connect and issue commands, but when i try the same from Perl, it not connects, waitfor just timeouts and displays that prompt is not matched: &quot;pattern match timed-out at &quot;.<BR>
  I'v tried all possible prompts but without any success.</p>
  <p>From console it works fine:</p>
  <pre><code>telnet xxx.xxx.xxx.xxx
  Trying xxx.xxx.xxx.xxx...
  Connected to xxx.xxx.xxx.xxx.
  Escape character is '^]'.
  &gt;&gt;User name:root
  
  &gt;&gt;User password:
  Huawei Integrated Access Software (MA5608T).
  ...
  </code></pre>
  <p>Here is my sample code:</p>
  <pre><code>use Net::Telnet ();
  $remote = new Net::Telnet (Timeout =&gt; 5,
                             Errmode =&gt; 'return',
                              Dump_Log =&gt; 'log.txt');
  $remote-&gt;open(&quot;xxx.xxx.xxx.xxx&quot;) or die $remote-&gt;errmsg;
  $remote-&gt;waitfor('/&gt;&gt;User name: $/i') or die $remote-&gt;errmsg;
  $remote-&gt;print(&quot;root&quot;) or die $remote-&gt;errmsg;
  $remote-&gt;waitfor('/&gt;&gt;User password: $/i') or die $remote-&gt;errmsg;
  $remote-&gt;print(&quot;&lt;;-)&gt;&quot;) or die $remote-&gt;errmsg;
  $remote-&gt;waitfor('/\$ $/') or die $remote-&gt;errmsg;
  $remote-&gt;print(&quot;display idle-timeout&quot;) or die $remote-&gt;errmsg;
  ($output) = $remote-&gt;waitfor('/\$ $/') or die $remote-&gt;errmsg;
  print $output;
  </code></pre>
  <p>and cat log.txt</p>
  <pre><code>&lt; 0x00000: ff fb 01 ff  fb 03                                  ▒▒.▒▒.
  &gt; 0x00000: ff fd 01 ff  fd 03                                  ▒▒.▒▒.
  &lt; 0x00000: 0d 0a 3e 3e  55 73 65 72  20 6e 61 6d  65 3a        ..&gt;&gt;User name:
  </code></pre>
  <p>How could the cause be?</p>