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

Hello all, I am trying to use perl Threads. So far I simply have the following line in the code:
use Thread;
I get the following error message:
This Perl has neither ithreads nor 5005threads at /usr/opt/BASperl/5.8 +.5/lib/Thread.pm line 335 BEGIN failed--compilation aborted at /usr/opt/BASperl/5.8.5/lib/Thread +.pm line 335. Compilation failed in require at main.pl line 8. BEGIN failed--compilation aborted at main.pl line 8.
Any idea on how to fix this ?

Replies are listed 'Best First'.
Re: Perl Threads
by jasonk (Parson) on Oct 03, 2006 at 18:15 UTC

    Just as it says, your perl was compiled without support for threads, you need to use a version of perl that was compiled with thread support.


    We're not surrounded, we're in a target-rich environment!
Re: Perl Threads
by asz (Pilgrim) on Oct 03, 2006 at 19:11 UTC

    for Perl 5.8.x the new threads implementation ithreads is recomended over the old one 5005threads. from the documentation of Thread:

    For new code the use of the Thread module is discouraged and the direct use of the threads and threads::shared modules is encouraged instead.

    be sure to check out perlthrtut - tutorial on threads in Perl, but first, as jasonk noted, you should get a Perl with threads enabled.

    :)))))
Re: Perl Threads
by shreya (Novice) on Oct 03, 2006 at 21:19 UTC
    I do not carry permissions to compile perl on the server. Is there any other way I can solve this problem ?
      What permissions are your problem? Can you compile and install a private version of perl, with ./Configure -des -Dprefix=/home/shreya -Dusethreads?

      What kind of server is it?