CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Win32 Programming Help:
changing shell metacharacters?


New User

Aug 9, 2005, 2:11 AM

Post #1 of 1 (5241 views)
changing shell metacharacters? Can't Post


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");


$(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 ...

Thanks in advance.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives