Hello world,

I'm trying to write a short script using Net::Telnet (first time with this module). I'm getting the hang of the various methods, but I've hit a snag.

My Unix account auto-launches an application (probably through .login or .profile). In an interactive telnet session, I break out of the application with Ctrl-\ (Control-Backslash) and continue working at a shell prompt. In my Perl script, I can't figure out how to break out of this app.

I've tried the break() method, but this doesn't work. My semi-educated guess is that this is sending a telnet break code, and not the Ctrl-\ the app or shell is looking for. I've also tried isolating the extended ASCII code for this key sequence and sending that via the print() method, but again no dice.

Any thoughts on how I can break out of this app? I'm not all that familiar with Unix, so I welcome all info on what might be happening in the background. Is the Ctrl-\ a standard "break" sequence, or is this app-specific? Is there a way to bypass the launching of this app on login?

If it matters, I'm developing this on ActiveState's Perl on a Win32 box, telnetting to a Unix host. In production, this script will be running on one Unix box, telnetting to another.

Thanks in advance!


In reply to Sending key sequence with Net::Telnet by EyeOpener

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.