opendir (DH, $directory); my @files = grep { -f "$directory/$_" } readdir(DH); close (DH);
Note that this code returns *only* the files from the directory, ignoring both the parent path 'dot' entries and sub-directory entries. If you want the sub-directory entries, change the grep code to read -
perl -e 's&&rob@cowsnet.com.au&&&split/[@.]/&&s&.com.&_&&&print'
In reply to Re: special directory entries
by rob_au
in thread special directory entries
by cybermack72
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |