Re: recursive search

2005-12-02 Thread Shawn Corey
The Ghost wrote: So far I did this: #!/usr/bin/perl use File::Find; my $totalLines; find(\&wanted, '@directories'); sub wanted { unless ($_=~m/.html|.mas|.pl|.txt$/i) {return 0;} #filter the kinds of files you want open FILE, "<$File::Find::name"; print "$_: ";

RE: recursive search

2005-12-02 Thread Charles K. Clarkson
Jennifer Garner wrote: [snip] : # Last modified: Apr 10 1997 [snip] Please do not provide outdated, buggy solutions to a beginners list. We are trying to do much more than just solve problems. We are (hopefully) fostering good programming skills first and

Re: recursive search

2005-12-02 Thread Jennifer Garner
#!/usr/local/bin/perl # # recurs.pl # # This script executes recursively on subdirs the command you supply as a parameter # # Run "program -h" to see the run options # # Last modified: Apr 10 1997 # Author: Bekman Stas <[EMAIL PROTECTED]>; # <[EMAIL PROTECTED]>; $|

RE: recursive search

2005-12-02 Thread Thomas Bätzler
The Ghost <[EMAIL PROTECTED]>asked: > I want to know how many new line chars there are in all files > in a directory (and it's subdirectories). What's the best way? Use File::Find to iterate over the files and then sum up the newlines you find in each file. Counting the newlines in a single file

RE: recursive search

2005-12-02 Thread Charles K. Clarkson
The Ghost wrote: : I want to know how many new line chars there are in all files : in a directory (and it's subdirectories). What's the best way? A lot depends on your idea of "best". It might be that the best way is to hand the project off to someone else and reap

Re: recursive search

2005-12-02 Thread Chris Devers
On Fri, 2 Dec 2005, The Ghost wrote: > I want to know how many new line chars there are in all files in a > directory (and it's subdirectories). What's the best way? I'm sure this isn't how you want to do it, but this might work: $ cat `find . -type f` | wc -l It'll choke if you have too

Re: recursive search

2005-12-02 Thread Jeff 'japhy' Pinyan
On Dec 2, The Ghost said: I want to know how many new line chars there are in all files in a directory (and it's subdirectories). What's the best way? You'll want to use File::Find (a standard module) to do your directory recursion for you. For each file you get to, open it, count its newli