Where does pp (PAR) unpack add (-a) files?

后端 未结 3 508
遇见更好的自我
遇见更好的自我 2020-12-11 19:19

This is my attempt to cut through extraneous issues raised \"Why don’t my system calls work in the Perl program I wrap with pp?\" I have created a simple Perl script on a l

3条回答
  •  暖寄归人
    2020-12-11 19:34

    Here is something that worked on my system:

    C:\tmp> cat build.bat
    @echo off
    mkdir output
    call pp -o runner.exe runner.pl -a sayhello.bat
    move runner.exe output\runner.exe
    
    C:\tmp> cat sayhello.bat
    @echo I am saying hello ...
    
    
    C:\tmp> cat runner.pl
    #!/usr/bin/perl
    
    use strict;
    use warnings;
    
    use File::Spec::Functions qw( catfile );
    
    my $prog_path = catfile $ENV{PAR_TEMP}, inc => 'sayhello.bat';
    
    my $output = `$prog_path`;
    
    print "The output was: >>> $output <<< ";
    
    __END__
    

    Output:

    C:\tmp\output> runner.exe
    The output was: >>> I am saying hello ...
    <<<
    

    This feels a little dirty, though.

提交回复
热议问题