# Filter out "." and ".." my @array = grep !/^\.\.?\z/, readdir(DIR);