Firstly, Term::Readkey is a pretty small module so it's no great overhead to install and use it and it seemed to do everything right whenever I used it. My advice would be to go with that.
It's not much overhead for the processor or RAM, but it's a fair bit of overhead for someone who isn't a Perl programmer and is thus unlikely to be familiar with the task of installing nonstandard Perl modules. It's more end-user overhead that I am to avoid, rather than system overhead, in this case.

As things currently stand, I have a workaround built into the thing so that it uses Term::ReadKey if it exists on the system (using an eval), but it's pretty kludgey, and it ends up having less slick, intuitive behavior for the less technically savvy user as a result -- pretty much the exact opposite of a desirable state of affairs.

As for your example code, it unfortunately looks pretty environment-specific (POSIX::Termios makes me think so, anyway). I prefer to avoid assumptions about the operating environment as much as possible when writing stuff like this, where its usefulness is not limited to a particular OS by definition. I appreciate the attempt at helping, though it ultimately doesn't really provide what I need.

print substr("Just another Perl hacker", 0, -2);
- apotheon
CopyWrite Chad Perrin


In reply to Re^2: y/n input in a captive interface by apotheon
in thread y/n input in a captive interface by apotheon

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.