in reply to Threads works if not checked

You are setting $thread_endless_loop to the return value of the detach() method, which is not documented to return a value. Perhaps you meant:

my $thread_endless_loop = threads->create(\&endless_loop); if (!($thread_endless_loop)) { my $message = "Main " . __LINE__ . ": Error"; die("$message Cannot create a thread\n"); } $thread_endless_loop->detach();
Note also that $! will not have any meaningful value on failure to create a thread.

Dave.

Replies are listed 'Best First'.
Re^2: Threads works if not checked
by mnooning (Beadle) on Jun 19, 2014 at 13:20 UTC
    Yes, that was it. Good eyes!