in reply to perl filenames and square brackets

One, square brackets are significant to glob just as they are to most UNIX shells (e.g. foo[abc] meaning match any of the files fooa, foob, or fooc), so you'll need to escape them with backslashes. Two, see File::Find or File::Find::Rule rather than reinventing the wheel.

Addendum: And you should test if something's a directory (see -d in perldoc -f -X) before trying to recurse down into it anyway.

Replies are listed 'Best First'.
•Re^2: perl filenames and square brackets
by merlyn (Sage) on Nov 18, 2004 at 18:22 UTC