It looks like you aren't using $category correctly. It must be scoped outside of the loop, so when you're finally outside the foreach loop, it just has whatever the last value assigned was. I would think you might want a hash keeping track of the category for each file instead. Something like: $category{$file} = "paper";
In reply to Re: Counting files in a folder
by lostjimmy
in thread Counting files in a folder
by JKasting
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |