opendir(D,"/proc/$$/fd/"); while ($fd=readdir(D)) { print "I've got this descriptor opened: $fd"; };