Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

What is wrong in this command for pp and the filter option on Windows?

pp -u -g -o MyExe -F Bleach='^(GUI_|AA_|myMainScript)' myMainScript.pl

the regex should pass to the bleach routines all modules starting with GUI_, AA_. etc.

Replies are listed 'Best First'.
Re: pp filter regex
by Eily (Monsignor) on Jun 22, 2018 at 13:08 UTC

    What's wrong is that there is no error message or output. Unless there was one and you forgot to tell us ;-).

    On Windows strings are delimited by " rather than '. It does output an error when I try this: echo '^(GUI_|AA_|myMainScript)'
    'AA_' is not recognized as an internal or external command, operable program or batch file.

      Sorry for forgetting the error message. Both using ' and " does output an error saying that the command myMainScript (in the regex) is written wrongly. On a Unix system the same works perfectly, but I am not quite sure how to write my Regex in the command line on a Windows machine...

        On a Unix system the same works perfectly, but I am not quite sure how to write my Regex in the command line on a Windows machine...

        Avoid the commandline, write a program.

        #!/usr/bin/perl -- use strict; use warnings; system 'pp.bat', ...;

        pp.bat ain't nothing but use pp; pp->go;

Re: pp filter regex
by AnomalousMonk (Archbishop) on Jun 27, 2018 at 13:45 UTC

    This reply is rather late I'm sorry to say, but FTR and FWIW, Windose really, really likes double-quotes around its command line arguments (tested on Win7):

    c:\@Work\Perl\monks>echo Bleach='^(GUI_|AA_|myMainScript)' 'AA_' is not recognized as an internal or external command, operable program or batch file. c:\@Work\Perl\monks>echo "Bleach='^(GUI_|AA_|myMainScript)'" "Bleach='^(GUI_|AA_|myMainScript)'" c:\@Work\Perl\monks>perl -le "print qq{>>$ARGV[0]<<};" Bleach='^(GUI_ +|AA_|myMainScript)' 'AA_' is not recognized as an internal or external command, operable program or batch file. c:\@Work\Perl\monks>perl -le "print qq{>>$ARGV[0]<<};" "Bleach='^(GUI +_|AA_|myMainScript)'" >>Bleach='^(GUI_|AA_|myMainScript)'<<
    (Can't test with  pp ATM.)


    Give a man a fish:  <%-{-{-{-<