pipe() とか socketpair() とか色々方法はあるけど、素直に IO::Pipe 使っとくと簡単便利。コアモジュールですし。 use strict; use warnings; use IO::Pipe; my $pipes = []; my $children = []; for my $i (1..10) { push @$pipes, my $pipe = IO::Pipe->new; my $pid = fork; if ($pid) { # parent $pipe->reader; push @$children, $pid; next; } # child die $! unless defined $pid; $pipe->writer; print {$pipe} "pid: $$, index: $i\n"; exit; } for my $pid (@$