open DIR, $ScratchDir or die $!; foreach my $file ( readdir(DIR) ) { print "$file\n"; }