$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,
},
$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
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