aarestad has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to recursively traverse a subweb that I moved from a FrontPage-based server to one that isn't. In the process, I want to blow away all of the _vti_cnf directories in this subweb. Consulting the Perl Cookbook, I came up with what I thought was the solution:
When run in the root of the subweb I wanted to process with no arguments, though, it only deleted the _vti_cnf directory in the root itself, and not any of the subdirectories like I wanted. What could I be doing wrong?#!/usr/bin/perl use File::Find; use File::Path; @ARGV = qw(.) unless @ARGV; sub process_file { ((-d _) && /_vti_cnf/) && rmtree $File::Find::name; } find (\&process_file, @ARGV);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Recursively blowing away directories of a certain name
by merlyn (Sage) on Nov 26, 2003 at 17:35 UTC | |
by aarestad (Sexton) on Nov 26, 2003 at 17:46 UTC | |
|
Re: Recursively blowing away directories of a certain name
by Aristotle (Chancellor) on Nov 26, 2003 at 18:03 UTC | |
|
Re: Recursively blowing away directories of a certain name
by dragonchild (Archbishop) on Nov 26, 2003 at 19:34 UTC | |
by revdiablo (Prior) on Nov 26, 2003 at 20:08 UTC |