Hmm, I tried Mr Dootson's monster but it almost hung the machine and
never returned ... I think this is probably too hard for what I need -
I will just use qx() on Windows as I don't need anything fancy ...

Many thanks for the replies though.

PK

On 23 May 2011 14:49, Mark Dootson <mark.doot...@znix.com> wrote:
> Hi,
>
> The following may be worth a try then, assuming pp passes all the arguments
> and assigning to S^X doesn't break everything else. :-)
>
> The code attempts:
>
> If I am packed exec and this is windows {
>  assign my execpath to $^X
>  Check if this is special case of IPC::Run::Win32Pump
>    run IPC::Run::Win32Pump and return.
>
>
> So $^X -MIPC::Run::Win32Pump -e 1 blah blah
> when called from pp packed executable ought to work
>
>
> BEGIN {
>
>    if($^O =~ /^mswin/i && defined($ENV{PAR_0}) && -f $ENV{PAR_0} ) {
>        $^X = $ENV{PAR_PROGNAME};
>        my $command = join(' ', @ARGV);
>        if($command =~ / -MIPC::Run::Win32Pump -e 1 \d+ \d+ \d+ \d+ \d+ \d+
> \d+ /) {
>            while( my $arg = shift( @ARGV )) {
>                last if($arg eq '1');
>            }
>            eval{ require IPC::Run::Win32Pump; };
>            die $@ if $@;
>            return;
>        }
>    }
> }
>
>
>
>
>
> On 23/05/2011 13:19, Roderich Schupp wrote:
>>
>> On Mon, May 23, 2011 at 1:34 PM, Mark Dootson<mark.doot...@znix.com>
>>  wrote:
>>>
>>> $^X -MIPC::Run::Win32Pump -e 1 blah blah
>>>
>>> Come to think of it, to make my ugly code work I think you need to use
>>> the
>>> --reuse option to pp - then I assume you get something workable in $^X.
>>
>> It's even more complicated :(
>>
>> - $^X is always the dummy string "perl"
>> - instead of $^X one could use
>>      $ENV{PAR_PROGNAME}  --par-options --reuse
>> - the original script must have been packed with "pp --reusable ..."
>> - even then perl command line options (e.g. -M, -e) won't work
>>
>> See also the recent thread about similar problem with POE.
>>
>> Cheers, Roderich
>
>



-- 
Dr Philip Kime

Reply via email to