in reply to Bad file descriptor error
you are closing the dirhandle IN the loop instead of after it. Just move the 'closedir' line after the following '}'
This is an example why it is better to use well-tested library code instead of redoing the same tasks over and over again. Take a look at File::Find, it might make your task easier next time.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Bad file descriptor error
by cdarke (Prior) on Mar 22, 2010 at 10:59 UTC | |
by jethro (Monsignor) on Mar 22, 2010 at 11:51 UTC | |
by Lamont85 (Novice) on Mar 22, 2010 at 20:57 UTC |