in reply to Re^2: writing portable file processing scripts that use placeholders in filenames
in thread writing portable file processing scripts that use wildcards in filenames
Perl's glob() expands bracket classes in some versions, usually in the same environments where the shells do too. If you don't want the shell to expand bracket classes, you escape them at the shell level: rm '[a-b]foo', or rm \[a-b\]foo. If you have to pass a bracket class to a program which globs for you, even after the shell would normally escape it, you may need to escape it twice. If this is a really common concern, then the "portable" way would be more elaborate. But then again, command line arguments are never going to be 100% "portable."
If your filesystem has allowed a ? or * in your filename, you'll need to use some more serious tools, because that's generally a filesystem bug.
--
[ e d @ h a l l e y . c c ]
|
|---|