hi, I have a scenario that I find it weird and might need to solve it by sending a ctrl+c through open3 function.

my perl script is run from windows, which will call plink (a command based putty to connect to Linux) to run Linux commands. All is fine if the process for Linux finishes and then gets back to windows.

now, my scenario is that while it is processing in plink, someone tries to do a control+c to break the running perl script abruptly.

it ends up windows command prompt has no processes running, but the Linux server connected from plink still thinks the process is not terminated. So I was wondering if I can detect a control+c is happening while perl script is running , then send the contrl+c command to open3's to plink before I terminate.

hi, is there anywhere I can send a ctrl+c to open3 before I exit my script?

In reply to send ctrl+c to open3? by adrive

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.