Now that I have changed the shell that perl calls via PERL5SHELL (I'm using UWIN on an XP SP2 system), is there any way to tell perl that the shell metacharacters are different for this shell than they are for cmd.exe (the default WIN32 shell)? When I run system commands via system or backticks, if my single Unix command has, for example, only (protected) $ substitution in it, perl optimizes out the call to the shell, and the substitutions don't get processed.

A simple contrived example:

$command = 'file $(whence ls)'; system("$command");

prints:

$(whence: cannot stat ls): cannot stat

because perl is exec'ing file.exe directly and passing it "$(whence" and "ls)" as two separate arguments. I can get this to work by changing the command to be '\file $(whence ls)', since \ is a known metacharacter, but that's a pain ...