1

I'm trying to make my perl prog portable across other perl installations. Looks like strawberry MinGW perl is doing a conversion that is messing things up.

When I run a system command, it appears to be converting the window's switches to absolute paths. I.e.

system('cmd /c "echo hello"');

gets executed as:

c:\Windows\system32\cmd.exe c:/ "echo hello"

That was taken from Process Explorer.

How do I stop this behaviour?

Adrian
  • 10,246
  • 4
  • 44
  • 110
  • That's pretty awesome. Do backslashes help in any way? eg. `\\/c` in place of `/c`? – Joe Z Nov 15 '13 at 03:29
  • I cannot confirm this behavior. – Slaven Rezic Nov 15 '13 at 08:26
  • @JoeZ, no, backslashes do not help. No, I was wrong, I need 3 backslashes to get it to work properly. But that's just messed up. :( – Adrian Nov 15 '13 at 16:11
  • @SlavenRezic, so you made a file that contains only that line and ran perl on it without it doing what I said? What version of perl are you using? I'm using `v5.8.8 built for msys-64int`. Miss typed version and corrected in question. – Adrian Nov 15 '13 at 16:12
  • I tried with Strawberry Perl. – Slaven Rezic Nov 16 '13 at 09:19
  • But with msys perl I can confirm this behavior. – Slaven Rezic Nov 16 '13 at 09:29
  • No answer, but some insightful links: http://stackoverflow.com/questions/7250130/how-to-stop-mingw-and-msys-from-mangling-path-names-given-at-the-command-line http://www.mingw.org/wiki/Posix_path_conversion – Slaven Rezic Nov 16 '13 at 09:52

0 Answers0