Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!texsun!convex!convex.COM From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.lang.perl Subject: namespace issues Message-ID: <109357@convex.convex.com> Date: 28 Nov 90 01:12:22 GMT Sender: usenet@convex.com Reply-To: tchrist@convex.COM (Tom Christiansen) Organization: CONVEX Software Development, Richardson, TX Lines: 29 I've been sitting here wondering why if readdir() is so much like , in that it returns the next element in a scalar context and the whole shebang in an array one, and it takes this special handle. Because we have effectively separate namespaces for files and directories, doing doesn't make a bunch of sense. Perl can't tell whether you want a file called "handle" or a directory called this, because both might exist. If, however, they shared a name space but had a bit attached to them internally telling which they were opened as, then we could write things like this: opendir(DIR, ".") || die "SNAFU"; $\ = "\n"; while () { print; next if /^\./ || -d; unlink; } My question is: does anyone (ab)use the fact that you can have both a file and a directory whose handle is "HANDLE", and thus whose script would break were this to change? When Larry comes back out of the Book, maybe he can fill us in on why he didn't do it that way in the first place. --tom