<?xml version="1.0" encoding="windows-1252"?>
<node id="835470" title="Ascii value is different" created="2010-04-19 08:12:59" updated="2010-04-19 08:12:59">
<type id="115">
perlquestion</type>
<author id="711414">
nagalenoj</author>
<data>
<field name="doctext">
&lt;p&gt;When I use the perl package Term::Screen and gets some input from user, newline's ASCII value is returning as 13. 
And, when I comment the use of Term::Screen, the ASCII value is returning as 10.&lt;/p&gt;
&lt;p&gt;
How does it got change?
&lt;/p&gt;
&lt;code&gt;
use Term::ReadKey;
# use Term::Screen;

# my $scr;
# $scr = Term::Screen-&gt;new;
# unless ($scr) { die "Couldn't create object for Term::Screen\n"; }
# $scr-&gt;clrscr;

# Get the user name and password
my ($user, $key);
print "\nYour name: ";

ReadMode 4; # Turn off controls keys
while (1)  {
    $key = ReadKey(0);
    if (ord($key) == 13)  {
        print "Newline got at 13";
        last;
    }
    if (ord($key) == 10)  {
        print "Newline got at 10";
        last;
    }
    print $key, "--", ord($key),"\n";
}
print $key, "--", ord($key),"\n";
ReadMode 0; # Reset tty mode before exiting

&lt;/code&gt;</field>
</data>
</node>
