468,765 Members | 817 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,765 developers. It's quick & easy.

ASCII Value for Keyboard input

Hi All,

I am writing a script for getting the ASCII value for the keyboard input.

The script:
#!c:\perl\bin -w
# sascii - Show ASCII values for keypresses

use Term::ReadKey;
ReadMode('cbreak');
print "Press keys to see their ASCII values. Use Ctrl-C to quit.\n";

while (1) {
$char = ReadKey(0);
last unless defined $char;
printf(" Decimal: %d\tHex: %x\n", ord($char), ord($char));
}

ReadMode('normal');
===================================
But when I execute after downloading ReadKey.pm at the perl location, I am getting the following error:

C:\Perl\site\lib\Term>perl e:\ET.pl
Can't locate loadable object for module Term::ReadKey in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at e:\ET.pl line 12
Compilation failed in require at e:\ET.pl line 12.
BEGIN failed--compilation aborted at e:\ET.pl line 12.

Kindly suggest.
Sep 29 '06 #1
1 10350
Hi All,

I am writing a script for getting the ASCII value for the keyboard input.

The script:
#!c:\perl\bin -w
# sascii - Show ASCII values for keypresses

use Term::ReadKey;
ReadMode('cbreak');
print "Press keys to see their ASCII values. Use Ctrl-C to quit.\n";

while (1) {
$char = ReadKey(0);
last unless defined $char;
printf(" Decimal: %d\tHex: %x\n", ord($char), ord($char));
}

ReadMode('normal');
===================================
But when I execute after downloading ReadKey.pm at the perl location, I am getting the following error:

C:\Perl\site\lib\Term>perl e:\ET.pl
Can't locate loadable object for module Term::ReadKey in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at e:\ET.pl line 12
Compilation failed in require at e:\ET.pl line 12.
BEGIN failed--compilation aborted at e:\ET.pl line 12.

Kindly suggest.

########

down loading is not sufficient alone

you need to install the package using the stanadard instrunctions on perl.org
Oct 3 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Haas | last post: by
13 posts views Thread by Randell D. | last post: by
5 posts views Thread by Lumpierbritches | last post: by
31 posts views Thread by Claude Yih | last post: by
19 posts views Thread by many_years_after | last post: by
399 posts views Thread by =?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?= | last post: by
2 posts views Thread by bytesbytes | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.