in reply to Thread Error

This Perl has neither ithreads nor 5005threads

That is one problem - your perl is not compiled to support threaded code. Get or build one that does.

The other problem. which isn't affecting you yet, is that you specify 5.8, but then use Thread;. That is the old 5.005 thread module. Perl 5.8 does ithreads by default, so use threads; is the proper invocation.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: Thread Error
by castaway (Parson) on Dec 17, 2003 at 07:55 UTC
    Not quite.. if you look at the documentation ('man Thread') in the most recent versions (5.8.0+), you'll see that 'use Thread' is now a frontend to either 5.005 threads, or ithreads, making the invocation valid for whichever perl.

    (Though of course when starting something new it's probably better to start off with the new interface.)

    C.

Re: Re: Thread Error
by arunsub (Novice) on Dec 17, 2003 at 06:40 UTC
    Thanx for the quick response, I am new to Perl in Unix, It would be a real help if u can provide some more details on how to implement threads in Perl on Unix. Note :- The same syntax works fine when I run the code in Windows (Perl 5.8.0).
      It runs fine on Windows, because the Windows perls come with threads built-in (cos Windows doesnt have forking, or some such reason.)

      Anyway, you'll either need to build a new perl on your system, which if you're a newbie to Unix probably isnt such a good idea, or you'll need to install a package (depending on which unix/linux/whatever you are using) containing a threaded perl.

      (Theres no way to just 'add' thread support to the perl you have installed, it needs to be compiled that way.)

      If you do want to compile your own, go to perl-5.8.2, grab the source, and read the README and INSTALL docs..

      You'll probably benefit from reading 'man Thread', which explains this.

      C.