Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
$data = "/dirpath"; opendir(DIR,$data) || die "$!"; @files = readdir(DIR); close(DIR); $number = 0; for(@files) { if($_ =~ /WORDHERE/gi) { $number++; } } print "total = $number\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Count word in my dir
by blue_cowdawg (Monsignor) on Jul 31, 2003 at 16:02 UTC | |
|
Re: Count word in my dir
by dreadpiratepeter (Priest) on Jul 31, 2003 at 15:50 UTC | |
|
Re: Count word in my dir
by broquaint (Abbot) on Jul 31, 2003 at 16:00 UTC | |
|
Re: Count word in my dir
by diotalevi (Canon) on Jul 31, 2003 at 16:37 UTC | |
|
Re: Count word in my dir
by hardburn (Abbot) on Jul 31, 2003 at 15:41 UTC | |
| |
|
Re: Count word in my dir
by beernuts (Pilgrim) on Jul 31, 2003 at 15:49 UTC | |
by Cine (Friar) on Aug 01, 2003 at 00:46 UTC | |
|
Re: Count word in my dir
by Grygonos (Chaplain) on Jul 31, 2003 at 15:41 UTC | |
by sgifford (Prior) on Jul 31, 2003 at 16:02 UTC |