Bareword "threads::joinable" not allowed while "strict subs" in use
The program is:
#!/usr/bin/perl
use warnings;
use strict;
use threads;
my $thread_num = 2;
foreach(1..10){
if(threads->list()>=$thread_num){
sleep(1);
foreach my $thr (threads->list(threads::joinable)){
$thr->join();
}
}
threads->create(\&runthread,$_);
}
while(threads->list()){
sleep(10);
foreach my $thr (threads->list(threads::joinable)){
$thr->join();
}
}
exit(0);
sub runthread
{
print($_[0],"\n");
print(threads->list(),"\n");
return 0;
}
The "perl -V" is:
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
Platform:
osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
uname=''
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
usethreads=define use5005threads=undef useithreads=define usemulti
+plicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags =' -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DPERL_IMPL
+ICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -DPERL_MSVCRT_R
+EADFIX',
optimize='-s -O2',
cppflags='-DWIN32'
ccversion='', gccversion='3.4.5', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='long lo
+ng', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='g++', ldflags ='-s -L"C:\strawberry\perl\lib\CORE" -L"C:\straw
+berry\c\lib"'
libpth=C:\strawberry\c\lib
libs= -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -
+lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -
+lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32
perllibs= -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspo
+ol -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luu
+id -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32
libc=-lmsvcrt, so=dll, useshrplib=yes, libperl=libperl58.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-mdll -s -L"C:\strawberry\perl\lib\CORE
+" -L"C:\strawberry\c\lib"'
Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT
PERL_IMPLICIT_SYS PERL_MALLOC_WRAP
PL_OP_SLAB_ALLOC USE_ITHREADS USE_LARGE_FILES
USE_PERLIO
Built under MSWin32
Compiled at Oct 19 2008 16:39:57
@INC:
C:/strawberry/perl/lib
C:/strawberry/perl/site/lib
.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.