Hm-m, suppose:

use strict; use warnings; use IPC::Run qw( start ); my @c = qw( cmd /c sort ); my $h = start \@c, '<pipe', \*IN, '>pipe', \*OUT; print IN "zzz...\n"; print IN "hello world\n"; close IN; pump $h; print uc while <OUT>; close OUT; finish $h;

to print uppercased sorted lines:

HELLO WORLD ZZZ...

But if packed to executable:

pp -o pack_test.exe pack_test.pl

the pack_test.exe gives:

Inappropriate I/O control operation: Win32::Process::Create() at C:\Us +ers\me\AppData\Local\Temp\par-766164696d\cache-2f8c1556e4a094e1c7eee6 +ea88e299192e77e2e4\inc\lib/IPC/Run.pm line 2150. Inappropriate I/O control operation: Win32::Process::Create() at C:\Us +ers\me\AppData\Local\Temp\par-766164696d\cache-2f8c1556e4a094e1c7eee6 +ea88e299192e77e2e4\inc\lib/IPC/Run.pm line 2251.

Looks like Win32::Process::Create wants absolute path at #345, and IPC::Run::Win32IO is overly optimistic to find it in $^X. Within PAR, this variable contains just 'perl.exe'. Even if there's no such file on the system.

In fact, I don't know how to properly invoke perl from PAR bundle (it does contain all binaries, doesn't it), so here's a dirty hack. Somewhere at line #311, put

local $^X = $ENV{ PAR_TEMP } . '\inc\perl.exe' if $^X eq 'perl.exe' and exists $ENV{ PAR_TEMP };

And then pack like this:

pp -M IPC::Run::Win32Pump -a C:\berrybrew\strawberry-perl-5.32.1.1-64b +it-PDL\perl\bin\perl.exe;perl.exe -o pack_test.exe pack_test.pl

and then pack_test.exe kindly gives:

HELLO WORLD ZZZ...

I have no idea if it's IPC::Run or PAR::Packer (or Perl itself built on Windows) fault; and whether it'll work for your multi-gigabyte multi-threaded app; and how many refined professionals dropped unconscious because of ugliness of the above hack, but it's something to start with.


In reply to Re: PAR-Packer and IPC-Run by Anonymous Monk
in thread PAR-Packer and IPC-Run by izomiac

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.