use POSIX qw[ close ]; POSIX::close( $_ ) for 3 .. 1024; ## Arbitrary upper bound