Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Perl Script to count files and directories is not working.

by psini (Deacon)
on Aug 26, 2010 at 18:37 UTC ( [id://857538]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://857538]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-03-28 08:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found