That can, of course, be golfed down quite a bit but hopefully it's pretty clear what's going on.my @dircontents = readdir(DIRHANDLE); my @dirs = grep { -d $_ && $_ !~ /^\.\.?$/ } @dircontents; my @files = grep { -f $_ } @dircontents; print "<B>$_</B><BR>\n" foreach (@dirs); print "$_<BR>\n" foreach (@files);
In reply to Re: reading files and directories
by DrHyde
in thread reading files and directories
by ctp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |