0

Hi,

I am learning perl. Here is the script from which I can get the ASCII values from the keyboard entry made by the user.


#!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 the script I am getting the following error even after installing the ReadKey.pm into the perl\site\lib.

ERROR:
E:\>perl ET.pl
Can't locate Term/ReadKey.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at ET.pl line 11.
BEGIN failed--compilation aborted at ET.pl line 11.


Any Light shed in this regard will be admired and appreciated. :eek:

2
Contributors
3
Replies
4
Views
10 Years
Discussion Span
Last Post by KevinADC
0

Thanks Kevin for your suggestion, But I did the same installation. But I am getting the error still. Please let me know.

0

might have something to do with the fact you run the script from the 'e' drive but the perl install is on the 'c' drive? Can you run other scripts on the 'e' drive no problem?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.