in reply to Massive File Editing
Problem #1 : You are invoking opendir(DIR) recursively, meaning that closedir(DIR) will generate system errors on the way back up. Still, this should not present a problem, as you are invoking readdir(DIR) in list context before recursing, so your results should not be affected. Either move the closedir() immediately after the readdir(), or use a lexical (my $dir) instead of a global (DIR).
Problem #2 : The regexp /.shtml/i is not anchored to the end of string (/.shtml$/i or /.shtml\z/i), and the '.' is not escaped to make it literal (/\.shtml$/i or /\.shtml\z/i). Meaning - any file that contains the string "shtml" after the first character will match. Again, this is not probable, and the problem would be that too many files were processed, instead of too few, so this is not likely to be your problem.
Sorry... I don't see any obvious errors other than the above two. What behaviour are you seeing that you find to be unexpected?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Massive File Editing
by Kage (Scribe) on Dec 15, 2002 at 07:17 UTC | |
by MarkM (Curate) on Dec 15, 2002 at 07:29 UTC | |
by Jaap (Curate) on Dec 15, 2002 at 10:21 UTC |