in reply to reading files and directories
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);
|
|---|