Aye,
You could use either the Term::Readkey (a la cooked mode) or Term::Readline::Gnu (a la shadow_redisplay) to achieve the same goal. I think i meant to say, use either of the Term::Read* modules.

The reason i am inclined to using the cpan modules (and suggested likewise) is that their whole point of the existance of the CPAN modules is to help the perl user write portable code. It's all good shying away from CPAN modules, you almost always can write cleaner, shorter, faster code without them and with hacks using external utilities but that guarantees little as the end-user might not be running the OS you presume he is running, he/she also might not have those external utilities your code depends on. Another principal reason for using the modules is that debugging's so much more easier since you know exactly how the modules behave, you have access to the code, etc. It might be fair to say, it's never safe to make presumtions about arbitrary external conditions, take control and ensure _your_ code is guaranteed to run (anywhere and everywhere, hopefully).

20061109 Janitored by Corion: Added formatting, links, as per Writeup Formatting Tips


In reply to Re: Interactive prompts inside a test harness by Anonymous Monk
in thread Interactive prompts inside a test harness by jkeenan1

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.