While fiddling around with 5.8.0 and threads I found problems getting the correct return from my threads using ->join Returning a scalar seems to be no problem but trying to return an array or hash seem to be evaluated in scalar context.
#!/usr/dev/perl/bin/perl -w use strict; use threads; use Data::Dumper; my $thread = threads->new( sub { my %foo; @foo{1..100} = (1..100); print Dumper %foo; return %foo } ); print "Upon Joining ", $thread->join;
In reply to threads->join Return Context. by submersible_toaster
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |