opendir FOO, "$dir" or die "Couldn't open $dir: $!"; @contents = readdir FOO; closedir FOO;