Personally, I see no reason to avoid spaces et al. My wife has no clue what characters are special, and has no problems saving files such as "Foo's resume & cover letter.sxd". (No, her name isn't really "Foo" ;-}) And it works just fine.
What you want to use to check for bad characters is simply
In your case, the only bad character is the slash, so we can eliminate the brackets:$folder =~ m<[bad characters here]>;
As for using at the command line - this is no different than writing documents in OpenOffice.org. If you want to load it, just put it in quotes. Or, using bash on Linux, just type the first few characters and hit the tab key - all escapes will be put in automatically for filename completion (assuming it is unique to the first few letters you typed in).$folder =~ m</>;
If you're going to programmatically call another program, you should be learning to use the list version of system and/or exec anyway. By eliminating the shell, you don't need to worry about special characters.
Whether $filename has spaces, or any other special character, or not, doesn't matter. It just works.system('/usr/bin/ooffice', $filename);
In reply to Re^3: checking for reserved characters
by Tanktalus
in thread checking for reserved characters
by Real Perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |