On Mon, Jan 12, 2009 at 16:05, icarus wrote:
> I'm trying to all count files in a home dir and all subdirs *except* a
> subdir called 'backup'.
When you run into the condition where you don't want to recurse
further, set $File::Find::prune to 1 (e.g. $File::Find::prune = 1 if
$_ = "./backup";).
I'm trying to all count files in a home dir and all subdirs *except* a
subdir called 'backup'.
How do I that? thanks in advance.
#!/usr/bin/perl
use warnings;
use strict;
use File::Find;
my $dir = ("/home/foo");
my $counter = 0;
find( { wanted => \&process, no_chdir => 0 }, $dir );
sub proce