Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Ascii value is different

by cdarke (Prior)
on Apr 19, 2010 at 13:13 UTC ( #835484=note: print w/ replies, xml ) Need Help??


in reply to Ascii value is different

UNIX terminals can run in canonical ('cooked') or non-canonical ('raw') mode. The difference is that in canonical mode certain characters are converted, for example Ctrl+c generates (by default) a SIGINT and <Return> gets translated to a new-line (crtonl).

The documentation for Term::Screen clearly states that it runs in raw mode, which means there is no conversion. ASCII character 13 is a CR, the code for the return key, in canonical mode this gets translated to 10, which is LF (a line feed).


Term::ReadKey has a ReadMode function which you could use to get consistent results.
See also, on the shell command-line, stty -a


Comment on Re: Ascii value is different
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://835484]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (12)
As of 2015-07-28 18:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (258 votes), past polls