Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
For those that don't have any silly "no modules" restrictions, this problem could be solved by using the Term::ReadKey module. For those that insist on re-inventing the wheel, reading the code in this module will probably help you along your way. Remember that even though you may (for whatever reason) not be able to use a module with your project, that doesn't prevent you from downloading it and reading through the code to see how they do it.

The short answer: check out the documentation for getc, which is Perl's implementation of the standard C function by the same name. Update: I highly recommend going with the FAQ links mentioned above, as there are some caveats with using getc on terminals.

If you need to be monitoring several input streams at once for data, and thus need to use select, that is a very weighty topic. See the documentation for IO::Select.. There are probably other tutorials floating around, but I doubt you're going to get a thorough lesson on select here. Good luck.


In reply to Re: select? by Fastolfe
in thread select? by BooK

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-19 19:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found