Perl and treads

By | August 22, 2009

Sometimes, you need to create other threads and let the main thread manage other threads.

This is an example how to create a thread in Perl:

#!/usr/bin/perl
use threads;
my $thr = threads->create(‘test’);
sub test
{
REPEAT:
print “This is a testn”;
goto REPEAT;
}
#!/usr/bin/perl
use threads;
my $thr = threads->create(‘test’);
sub test
{
REPEAT:
print “This is a testn”;
goto REPEAT;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.