| hand waving on how we got here... | opendir(DIR,".") or die $!; while(my $name=readdir(DIR)){ next if -d $name; # takes care of . and .. as well | do something with file here... }