tonin has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to use the thread implementation and I always get this message when running my scripts : 'No threads in this perl at script_name.pl line xx' But I've installed a perl.rpm that seemed to include threads (at least it does recognize the 'use Thread' instruction, which wasn't the case with the Redhat 7.0 distro). What am I missing ? Thanks for answers.

Replies are listed 'Best First'.
Re: Using threads in perl
by AgentM (Curate) on Apr 02, 2001 at 20:50 UTC
    Your perl executable may not have been compiled with threads support. The best solution is not to use the current PerlThreads since several brutally obvious race conditions thwart proper use.
Re: Using threads in perl
by Daddio (Chaplain) on Apr 03, 2001 at 01:36 UTC
    If you want to check your Perl install for Threads support, try this...
    use Config; $Config{usethreads} or die "Recompile Perl with threads.";
    I have been using threads for a couple of months now, and so far (knock on wood) have had no problems. Your mileage may vary.

      Would 'perl -V' and looking at the 'usethreads=' (6th line down) be easier?

      Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration: Platform: osname=linux, osvers=2.2.5-22smp, archname=i386-linux uname='linux porky.devel.redhat.com 2.2.5-22smp #1 smp wed jun 2 0 +9:11:51 edt 1999 i686 unknown ' hint=recommended, useposix=true, d_sigaction=define usethreads=undef useperlio=undef d_sfio=undef Compiler: cc='cc', optimize='-O2 -m486 -fno-strength-reduce', gccversion=egc +s-2.91.66 19990314/Linux (egcs-1.1.2 release) cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include' ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include' stdchar='char', d_stdstdio=undef, usevfork=false intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +2 alignbytes=4, usemymalloc=n, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -ldl -lm -lc -lposix -lcrypt libc=, so=so, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynami +c' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Built under linux Compiled at Aug 10 2000 15:33:00 @INC: /usr/lib/perl5/5.00503/i386-linux /usr/lib/perl5/5.00503 /usr/lib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/site_perl/5.005 .
      --Chris

      e-mail jcwren