The kind of "quotes" that are needed for various shells vary.

I personally stay away from this "perl -e" syntax for a couple of reasons:
1)if the program that the -e does is "significant", I want to give it a name, make it a "real Perl" file and put it my personal library and maybe even alias it in my shell.
2) The resulting program file is executable on multi-platforms (I work on Linux and MS Windows).

So maybe my question sounds dumb, but why do you want to do that? I haven't found a good reason yet.

I am sure that we will hear how to make it work, and I also would find it interesting. In general this shell syntax problem also boggles my mind and is platform specific. I just avoid it by making a Perl executable file.

You are correct in that perl -e "print \"Hello World\"" works from the Windows command line. But a file with: print "Hello World"; works also and is a lot more clear.


In reply to Re: Running perl from java by Marshall
in thread Running perl from java by abramia

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.