我在我的程序中使用了threads模块。
但是当我运行test.pl脚本时,我得到了这个错误:
Can't locate threads.pm in @INC (@INC contains: /opt/perl5.00503/lib/5.00503/sun4-solaris /opt/perl5.00503/lib/5.00503 /opt/perl5.00503/lib/site_perl/5.005/sun4-solaris /opt/perl5.00503/lib/site_perl/5.005 .) at ./test.pl line 10.
BEGIN failed--compilation aborted at ./test.pl line 10.在哪里可以找到threads.pm并将其包含在@INC变量中?
虽然Perl5.8和更高版本提供了线程模块,但是perl 5.00503中是否还有其他可用的线程模块呢?
发布于 2013-10-04 19:40:31
线程支持不只是你可以添加的东西。它必须从头构建到解释器中。线程模块为5.8中添加的内置线程支持提供了一个接口
您可以尝试使用forks。它提供与threads相同的接口,但使用进程而不是线程。
你没有说为什么你需要线程。Coro提供的协作多任务处理也有可能做到这一点?
https://stackoverflow.com/questions/19176031
复制相似问题