在linux系统中安装perl程序编译的最后几步或者已经安装完成、运行程序时,可能会出现“Can’t locate Term/ReadKey.pm in @INC” 的错误。
Term::ReadKey - A perl module for simple terminal control
Term::ReadKey is a compiled perl module dedicated to providing simple control over terminal driver modes (cbreak, raw, cooked, etc.,) support for non-blocking reads, if the architecture allows, and some generalized handy functions for working with terminals. One of the main goals is to have the functions as portable as possible, so you can just plug in “use Term::ReadKey” on any architecture and have a good likelyhood of it working.
以上来源于cpan.org对于Term::ReadKey的说明,可以看出Term::ReadKey是一个已经编译好的模块,能够为各种终端驱动模式提供控制。我认为Term::ReadKey类似于一个底层框架,为各种perl程序提供支持。
解决方法 :
在终端中输入
#cpan
,
如果不行,则输入
#perl -MCPAN -e "shell"
.
然后出现cpan>提示符后,输入命令
install Term::ReadKey.
正常情况下, 系统就会自动寻找合适的镜像站点,从网络安装Term::ReadKey.
再编译或运行,程序就可以了。