in reply to Counting files in a folder
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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Counting files in a folder
by JKasting (Novice) on Feb 11, 2010 at 18:29 UTC | |
by lostjimmy (Chaplain) on Feb 11, 2010 at 18:47 UTC |