I think this is truly a newbie question, but I am forced to ask, since could not find what I need neither here or in the internet (searching for command line, perl and such).
Please can someone tell me if it is possible to give perl a "program, line by line" from the command line with activeperl? I run perl on a win2k PC.

I know one can go into perl shell, type the lines and go CTRL+Z, but I'd like something like:
c:\>perl '#!usr/bin/perl print "\nhello, world!";'
NOTE: if you are new to perl inline compile, typing perl into the command line (when perl exe is in your system path) executes the shell, from where you can type perl code and execute it after you press CTRL+Z followed by return
EXAMPLE
C:\>perl print "\nHello world. Hope it's not rainy today!"; ^Z Hello world. Hope it's not rainy today!
Am I asking something possible, or I am simply in delirium?
I hope I have been clear in my request.
Thanks everybody.

In reply to Command line perl 'compile' by CodeHound

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.