HI dudes,
i am trying to get the folder name from a directory. I am currently using the script below to get the content of the directory:
opendir(DIRHANDLE,"/usr/darren") || die "file to open";
@FILES = grep !/^\.\.?$/, readdir DIRHANDLE;
while (<@FILES>)
{
chop();
$REC = $_;
@LINEREC = split(/\./,$REC);
print "$REC\n";
}
closedir(DIRHANDLE);
By using the above method, will will get all the listing including the directory and files. how can i only show the directory in /usr/darren/?
Cheers,
Darren