my $listen = {}; foreach $kid (qw/ ACE DEUCE TREY OOPS/ ) { $listen->{$kid} = do { my ($from,$to,$pid); pipe $from, $to; # fork and all, child closes $from, # deletes $listen, does child code and exits. { handle => $from, pid => $pid } }; }