my (@TOP) = # top level directories qw(/www); sub PRUNE { # don't search these dirs ## $_[0] is basename, $_[1] is full path $_[0] =~ /private/; } sub IGNORE { # don't notice these files ## $_[0] is basename, $_[1] is full path $_[0] =~ /^\.|~$|\.(gif|jpe?g)$/; } find (sub { return $File::Find::prune = 1 if PRUNE $_, $File::Find::name; return unless -f; # only files return if IGNORE $_, $File::Find::name; }, @TOP);