Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Comment on


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.

How does it got change?

use Term::ReadKey; # use Term::Screen; # my $scr; # $scr = Term::Screen->new; # unless ($scr) { die "Couldn't create object for Term::Screen\n"; } # $scr->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

In reply to Ascii value is different by nagalenoj

and:  <code> code here </code>

  • Please read these before you post! —
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Log In?

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

    How do I use this? | Other CB clients
    Other Users?
    Others pondering the Monastery: (7)
    As of 2014-12-28 13:27 GMT
    Find Nodes?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?

      Results (181 votes), past polls