Don't forget that each module has documentation that can be accessed via
'perldoc Module::Name'

So try 'perldoc File::Find' (without the quotes) at the command-prompt.

Hint:  Check the section called "The Wanted Function".

For the file size, you will probably use the stat function.  One way to
do this is to use an array slice like so:

my $dirsize = (stat $_)[7];

Hint:  File::Find sets $_ to the current filename.  Do a 'perldoc -f
stat' to see what the other elements are that might be useful.  7 is the
file size in bytes.

Remember that the "Wanted" function (BadNames in your case) will execute
for each file.




-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 21, 2005 1:38 PM
To: beginners@perl.org
Subject: File Finding 

Hello

I got the file command to work but it is not as complete as I would have
hoped for. I was hoping to get the file size and directory of the file
so I could put them into arrays. Is there a way I can do it with the
find command?

Andrew



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to