# Skip the builtins, they are all kept and it doesn't hurt to have # them but they are already handled. my @fds = grep { $_ > 2 } IO::Async::OS->potentially_open_fds(); # Keep them all open. Parens are to make the parser trust that # map was given a code reference and not a hash reference my @setup = map { ("fd$_" => 'keep', ) } @fds; # ... later ... my $thing = IO::Async::Whatever( code => sub { ... }, setup => \@setup );