Given that (and I could be wrong here) Perl was first developed on Unix and Unix takes the view that files and directories are the same thing I'm not surprised. A directory on *nix is just a file of I-Node pointers with file names as the index key. (an oversimplified explanation I realize)