opendir(DIRHANDLE,"/usr/darren") || die "file to open";
"file to open"?!? How 'bout $! anyway? (Check perldoc perlvar.)
Whatever, I really wonder why people insist so much in reinventing the wheel where a simple glob would do.
Is '.' fine? I mean: I'm not saying it is not. Simply generally people who reinvent the wheel do throw away it too...@FILES = grep !/^\.\.?$/, readdir 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/?
-d is your friend. Check perldoc -f -X:
In reply to Re: get directory listing
by blazar
in thread get directory listing
by darrengan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |