T
Taewoon Kwon
Nowadays, I learn about perl ithreads, reading perlthrtut perldoc.
I tested a sample code in that document
#---code start
use threads;
$thr = threads->new(\&sub1);
@ReturnData = $thr->join;
print "Thread returned @ReturnData";
sub sub1 { return "Fifty-six", "foo", 2; }
#---code end
and result of above code was printing '2', not 'Fifty-six foo 2'.
As far as I know it should print the 'Fifty-six foo 2'.
Could somebody explain the result?
Platform I tested the code was ActiveState Perl v5.8.4 for windows, and
perl v5.8.1 built in Mac Os X. Both showed the same result.
I tested a sample code in that document
#---code start
use threads;
$thr = threads->new(\&sub1);
@ReturnData = $thr->join;
print "Thread returned @ReturnData";
sub sub1 { return "Fifty-six", "foo", 2; }
#---code end
and result of above code was printing '2', not 'Fifty-six foo 2'.
As far as I know it should print the 'Fifty-six foo 2'.
Could somebody explain the result?
Platform I tested the code was ActiveState Perl v5.8.4 for windows, and
perl v5.8.1 built in Mac Os X. Both showed the same result.