【发布时间】:2013-07-03 17:16:59
【问题描述】:
我开发了一个 perl 脚本,它运行在具有不同 perl 版本的主机上,有时使用线程编译,有时不编译。
我有一个
use if $Config{"useithreads"}, "threads";
而且我所有的线程特定代码都在类似的条件下。
但是,在编译阶段,perl 仍然会在 threads::all、threads::running 等上阻塞。
我如何不确定我的脚本是否在线程和非线程 perls 上运行?
[ worr on worr-mn1 ] ( manage_usr_local_admin ) % perl -c acct_mgr_ng.pl
Bareword "threads::joinable" not allowed while "strict subs" in use at acct_mgr_ng.pl line 117.
BEGIN not safe after errors--compilation aborted at acct_mgr_ng.pl line 541.
【问题讨论】:
-
如果 $Config{useithreads},您希望在 BEGIN 块中要求线程,而不是使用它。
-
展示“窒息”的样子
标签: multithreading perl