Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Perl6 Threads

by Anonymous Monk
on May 04, 2016 at 17:03 UTC ( [id://1162208]=perlquestion: print w/replies, xml ) Need Help??

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

I saved "my $thread = Thread.start({ for 1 .. 10 -> $v { say $v }});" from https://docs.perl6.org/language/concurrency#Threads into a file and ran "perl6 file.pl" but get error "Undeclared name: Thread used ..." Any ideas how to fix the problem? (The document doesn't mention using any packages.)

Replies are listed 'Best First'.
Re: Perl6 Threads
by morgon (Priest) on May 04, 2016 at 17:17 UTC
    I would assume that you need a "use Thread;"before your code.

    But I am only guessing, I have never really used perl6.

      Please tell us what perl6 --version gives you
        perl6 version 2013.12 built on parrot 5.9.0 revision 0
      Then the message is "Could not find Thread in any ... (directories)"
        Your initial code works as is.

        I've just tried it with the rakudo from Debian testing (2016.04).

        So I assume there is something wrong with your installation.

        I'd do a clean install of the latest rakudo, otherwise you just end up chasing non-issues due to a broken install...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1162208]
Approved by jellisii2
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-03-28 08:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found