Hi All,
I wrote a small code distribution script for N-Tier applications, that uses NET::Telnet to do backups of remote servers before pushing the code, and to explode the code.tar after it has been pushed. This worked great for a good long time, but now suddenly, with no changes to my code, the script is core dumping occasionally during the backup portion. It doesn't happen on the same server every time, or even happen at all every time, so I suspected some kind of timeout problem was causing the core. If any- one can give me an idea of what might be causing this, I would be most appreciative. The specific code in question follows. (Feel free to e-mail responses to robert.a.flach@mail.sprint.com as well as or instead of posting them here, if my question is not of general interest)

code snippet
foreach $serv (@servers) {
   $ses = new Net::Telnet(-host => "$serv",
           -timeout => "1000"
           -errmode => sub { wait; } );
   $logtxt = "Now telneting to server $serv";
   &logit;
   $logtxt = "Starting backup process for server $serv";
   &logit;
   $ses->login($user,$pass);
   $hold = $ses->cmd("cd /$settings6");
   $logtxt = "Directory /$settings6 Entered";
   &logit;
   @hold = $ses->cmd("tar cvf archives/$settings[0]_${time}_bak.tar $settings[0]");
   $logtxt = "Backup File Created:";
   &logit;
   @hold = $ses->cmd("compress archives/$settings[0]_${time}_bak.tar");
   $logtxt = "Backup File Compressed:";
   &logit;
   $ses->close;
   $logtxt = "Backup for Server $serv Complete";
   &logit;
   $ses->DESTROY;
   $logtxt = "Telnet session ended";
   &logit;
}
End of Code Snippet
P.S. I couldn't get the brackets to display properly around the numbers on the arrays, but they are there.

In reply to Net::Telnet core dumps by raflach

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.