@xmlFileNames=grep !/^\.\.?$/ && /\.xml$/,readdir(DIR); The number of xml you get is the number of total customers.