Re: IOScalar with threads dose not work

2010-03-24 Thread iizuka
$i = 0; $i < 10; $i++) { $thr[$i] = threads->create( sub{my $i = shift; my $buf; open my $fh, ">:scalar", \$buf; print $fh "test$i"; close $fh; return \$buf; }, $i); } for (@thr) {push @result,

Re: IOScalar with threads dose not work

2010-03-24 Thread IIZUKA Soichi
}, $i); } for (@thr) {push @result, $_->join();} for (@result) { print $$_, "\n"; } Thanks again. 2010年3月23日22:12 Shlomi Fish : > Hi iizuka! > > On Tuesday 23 Mar 2010 09:53:54 iiz...@sizk.net wrote: >> I'm tryi

IOScalar with threads dose not work

2010-03-23 Thread iizuka
I'm trying to make threaded Net::Telnet program. I want all "input_log" to be written to one file. So I tried to give an IOScalar FileHandle to "input_log", then output real file later. IOScalar works fine, threads works fine. But together dosen't work. Here is sample script. Any suggestions appre