chuleto1 has asked for the wisdom of the Perl Monks concerning the following question:
Monks,
When reading a a directory, I would like to differentiate between a file and directory. Read Comment below....
When reading a a directory, I would like to differentiate between a file and directory. Read Comment below....
Any suggestions@return_files = readDirectory($directory); foreach(@return_files) { next if ($_ eq "." || $_ eq ".."); ####################### #How can a tell between files and directories? ######################## print OUT "<ul> <li id=\"foldheader\">$_</li>"; print OUT "</ul>"; } sub readDirectory { opendir DIR, $directory; @files = readdir(DIR); return @files; closedir(DIR); }
Back to
Seekers of Perl Wisdom