in reply to command line error

Try this:

perl -e "print qq/XXX/;"

The msdos shell (or whatever they call it nowadays) wants you to use "....". Of course that leads to the problem that you can't use double quotes within the code, so you use an alternative such as qq// instead. Alternate quote-like operators such as qq// are discussed in perlop. When your actual code has embedded double quotes the command shell parses it wrong.

There is some information in this document, if you search its content for the word "quote"

http://technet.microsoft.com/en-us/library/cc723564.aspx

So for *nix environments, wrap your code in '...', and in Win/dos environments, wrap it in "...".


Dave

Replies are listed 'Best First'.
Re^2: command line error
by hsfrey (Beadle) on Apr 12, 2012 at 21:08 UTC
    Thanks Dave, That did it!

    I just escaped the inner double quotes, and it all worked fine.

    It's surprising that the Active Perl documentation says nothing about this problem.

    Well, maybe I shouldn't be surprised - their documentation is a total kloodge.

      To be fair, this has more to do with the MSDOS prompt than it does with Active Perl.