readdir

The following piece of codes reads all file names of the process working directory into an array.

opendir( D, ".");
@files = readdir(D);
closedir( D);