The directory listing
#! /usr/local/bin/perl use Cwd; $dir = cwd; print "dir=> $dir\n"; opendir(THISDIR, "$dir"); @dirList = <THISDIR>; print "OPEN @dirList\n"; @dirList = readdir THISDIR; print "READ @dirList\n"; print "\n\nThe directory listing after using readdir\n"; foreach $dir (@dirList){ print "$dir\n"; }