title: "pattern match read eof" error for telnet connection using Perl
body: <p>I am trying to open a telnet connection, execute some command, and terminate the connection.  I need it to run around 1000 times.  The script runs fine for some number of attempts [ say around 23 - 25 ]. Then, I get the following error:  </p>
  
  <p><strong>"pattern match read eof at perlscript.pl line 23"</strong></p>
  
  <p>The line 23 corresponds to the code  </p>
  
  <p><code>$tn-&gt;waitfor('/Password: /i')</code>.  </p>
  
  <p>After this error, if I try to open the telnet connection manually, I get an error:  </p>
  
  <p>"<strong>Service and queue are full. Please come back later</strong>"</p>
  
  <p>I guess I get that first error "pattern match read eof" because the telnet connection is terminating because of the "Service and queue are full" error.  </p>
  
  <p>I was trying to debug more into the issue and when I checked the logs, I came across this error:  </p>
  
  <p><code>2012 08 08 10:27:46 EDT: Exception occured:</code><br>
  <strong><code>java.lang.NullPointerException</code></strong><br>
  <code>at dtw.telnetd.net.Connection.close(Connection.java)</code><br>
  <code>at dtw.telnetd.net.ConnectionManager.cleanupBroken(ConnectionManager.java)</code><br>
  <code>at dtw.telnetd.net.ConnectionManager.run(ConnectionManager.java)</code> </p>
  
  <p>Any idea on what could be causing this Exception?</p>