in reply to get contents of directory

Besides the usual opendir(), readdir() and closedir() routine to read a directory's contents, you could also use glob(), but it's pretty slow. Opening a file for writing, like mentioned above, can be achieved with open().
opendir(DIR,"/somedir") || die $!; @Files = readdir(DIR); closedir(DIR);

Greetz
Beatnik
. .. Quidquid perl dictum sit, altum viditur.