Gossamer Forum
Home : General : Perl Programming :

How to count the total of files which were stored inside folder + subfolder + sub again

Quote Reply
How to count the total of files which were stored inside folder + subfolder + sub again
Hello !

This is how I count how many file inside the folder $dir

opendir(DIR, "$dir") ;
@array = grep(/\.txt/,readdir(DIR));
closedir (DIR);

$total = @array ;

My question is : how to count the total .txt files which were stored inside subfolder/subfolder/.... (entire folder)

Hope anyone can help me here !

Thank a lot !

N.A
Quote Reply
Re: [newage24] How to count the total of files which were stored inside folder + subfolder + sub again In reply to
Have a look at

http://www.perldoc.com/...0/lib/File/Find.html

Ivan
-----
Iyengar Yoga Resources / GT Plugins