On 5/23/2011 7:23 AM, Philip Kime wrote:
I don't really understand why this works fine unpacked but doesn't when packed
...
As Mark said below, this happens because the IPC::Run module on Win32
(only) tries to run subprocesses using $^X, which normally contains the
path to perl.exe. However, when PAR packs an executable, $^X doesn't
happen to point to perl.exe, and so IPC::Run fails at that point.
Implementing IPC::Run on Windows without using subprocesses is an
unsolved problem.
IPC::Run::run() is almost always overkill for the tasks it's used for. I
wrote it and even I only use it rarely. As Roderich said, IPC::Run3 is
probably a faster, simpler choice. And Perl's backticks and pipe open
were designed for doing things like the example you show and are simpler
and faster than IPC::Run3 if you don't need to quote $filename or need
kpsewich's exit code.
- Barrie