Scripting >> Perl >> How to list a directory

#!perl $dirname = "../htdocs"; opendir(DIR,$dirname); @files = grep{!/^\./} readdir(DIR);# remove the dots closedir(DIR); foreach $file (@files) { print "$file\n"; }