my @fds = `ls /proc/$$/fd`; chomp @fds; #### require 'syscall.ph'; # May have to run h2ph first. for my $fd (@fds) { syscall(&SYS_close, $fd) == -1 or die $!; }