http://qs321.pair.com?node_id=286424

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....
@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); }
Any suggestions