There is no such way like qq{"$filename"} or \Q"$filename"\E to send to system " because perl has a big bug in this part :(
Hi rahmud,
Just because you do not know how to do something, does not mean that it cannot be done. Handling special characters properly is the responsibility of any coder. As I explained in my previous post, you cannot simply include a random double quote in a file name when working from the command prompt. Instead, you must escape it in order to get unix to work with it properly.
There are often similar types of experiences within windows. In order to navigate to the directory My Documents, you must enclose the entire thing in double quotes.
cd "My Documents"
This is just the necessary burden for people who use more than just simple alphanumeric characters in file and directory names.
When running system commands, perl can only handle these types of issues as well as the native operating system can. If you were trying to run the above change directory command, you would also have to include double quotes.
system("cd \"My Documents\"");
Is this a bug? no. This is just how you must communicate with other environments. In the language and specification that they'll understand.
This is why I originally suggested to the poster that the simpliest method is to simply avoid system level interaction and stick with pure perl solutions. It avoids the need for escape and knowing what type of operating system that perl is running on.
- Miller