in reply to Count word in my dir
This will find all the files in the $data directory, and search each file matching against the regex passed to grep, we then enforce scalar context on the return of find to get the count of the files that matched the criteria. See. File::Find::Rule for more info on this marvellous module.use File::Find::Rule; print "total = ", scalar find( file => maxdepth => 1, grep => qr/WORDHERE/, in => $data );
_________
broquaint
|
|---|