in reply to Re^2: Counting files in a folder
in thread Counting files in a folder

OK well here are some things you can try:
  1. Are you sure you have the right directory in $file_path? File::Basename explicitly states that dirname does not always give the proper director, and that fileparse should be used instead.
  2. Are you sure the file glob is working? Does the @files array actually contain the files you are expecting?
  3. Are you sure you aren't just forgetting to use the $category at the appropriate time like I stated in my last post? I don't see anywhere in your code that you actually use $category, and so after exiting the loop you only have the last assigned value.