in reply to Perl Script to count files and directories is not working.

First of all, use strictures (use strict; use warnings;)! This could show you some of the errors.

You first initialize a scalar $dir with a path but then overwrite it with for $dir ( @dirs ) { extracting from an undefined array @dirs.

you open and close OUTF, but then you print to stdout, so your output go to the shell and not to the log file.

Update: I didn't notice you are a new user; welcome to the Monastery!

Rule One: "Do not act incautiously when confronting a little bald wrinkly smiling man."

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.