print "Total count = ",(scalar @files),"\n\n"; for(@files) { print "$_\n"; $ct++ } # leaving this in here so you can make sure it prints the # same thing print "\nTotal count = $ct\n";