in reply to piping commands to perl via standard input on the Win32 command line

The problem is that Win32's "echo" preserves the quotes and so is poorly suited for this task:

C:\>echo "print qq(Hello.\n)" "print qq(Hello.\n)"
vs.
$ echo "print qq(Hello.\n)" print qq(Hello.\n)
so you get the equivalent of perl -e "\"print qq(Hello.\n)\"" instead of perl -e "print qq(Hello.\n)" So piping other things to perl works fine in Win32 (so find2perl shouldn't be a problem -- I used it quite recently).

        - tye (but my friends call me "Tye")

Replies are listed 'Best First'.
Re: (tye)Re: piping commands to perl via standard input on the Win32 command line
by mkmcconn (Chaplain) on Jan 09, 2002 at 23:49 UTC

    The problem is that Win32's "echo" preserves the quotes and so is poorly suited for this task- tye

    That's why you shouldn't echo quotes unless you mean for perl to see them as for example, this in CMD:

    echo system("time /T") ; print "\nHello world!\n" | perl -w

    10:47a
    Hello world!
    mkmcconn
    fiddled with example

      "echo" still isn't well suited for this. Many (even "most") Perl scripts will contain characters that Win32 command prompts won't give to "echo" (unless you put them in quotes which "echo" is too stupid to strip). In particular, < > | & ^ will cause problems while % might or might not be left alone.

              - tye (but my friends call me "Tye")