There's more than one way to do things | |
PerlMonks |
diamond operator questionby Tomtom (Scribe) |
on Jun 09, 2005 at 07:56 UTC ( [id://464995]=perlquestion: print w/replies, xml ) | Need Help?? |
Tomtom has asked for the wisdom of the Perl Monks concerning the following question:
Hello everyone, I know that the diamond operator reads lines ( one line in scalar context, and all lines in a list context ) from a file. On the other hand, I read this : "A directory is actually implemented as a file that has one line for each item contained within the directory."from here (although I remember reading this somewhere else too). I was wondering why, since directories are considered being "the same" as files on UNIX systems, the diamond operator doesn't work on directories. I'm not sure, but doesn't the diamond operator call readline for a file ? Why doesn't it call readdir for a directory ?
Back to
Seekers of Perl Wisdom
|
|