我是线程新手,这就是我所做的:
my $thread_fifo = threads->create(sub {Plugins::Fifo->run($conf, $products, $workfifo)});
my $thread_liberty = threads->create(sub {Plugins::Fifo->run($conf, $products, $workliberty)});
接着 :$thread_fifo->join(); $thread_liberty->join();
这是错误消息:
Thread 1 terminated abnormally: Can't call method "getChildrenByTagNameNS" on unblessed reference at C:/strawberry/perl/site/lib/XML/Atom/Util.pm line 61.
要查看$thread_fifo
我使用的是什么 ref 和 Dumper :
print ref($thread_fifo); # output : threads
print Dumper($thread_fifo); #output : $VAR1 = bless( do{\(my $o = '78589096')}, 'threads' );
我知道一个未受祝福的引用错误是一个变量不是对一个对象的合法引用,但是却试图在其上调用一个函数,就好像它是一个合法对象一样,但是我看不出问题出在哪里,我只是我想做的是同时调用两个函数。
提前致谢。