"Thanks for trying to help. I really appreciate it! ..."

While I'm happy to help, you need to help us as well. Posting all your text and code in a single block without any markup makes it very difficult to read. Put your text into paragraphs within <p>...</p> tags and your code within <code>...</code> tags. Details can be found in (or linked from) "Writeup Formatting Tips"; and "How do I change/delete my post?" explains how to fix what you've already done.

After putting your code into some sort of readable layout, it would appear that what I'm talking about is pretty much the same thing that you're learning about:

$ perl -Mstrict -Mwarnings -E ' my $numone; my $numtwo; print "Please enter first number "; $numone = <STDIN>; print "Please enter second number "; $numtwo = <STDIN>; #if ($numone < $numtwo); { <--- WRONG: no semicolon here if ($numone < $numtwo) { print $numone; print $numtwo; } # elsif { <--- WRONG: should be else else { print $numtwo; print $numone; } print "Hit enter when done: "; <>; ' Please enter first number 456 Please enter second number 123 123 456 Hit enter when done:

So, in this context, "<>" is just a short-hand form of "<STDIN>": see "perlop: I/O Operators" for the full story. Also, I don't assign the user input to a variable because I don't want it and, in fact, don't really care what the user enters. This works the same:

$ perl -Mstrict -Mwarnings -E ' ... previous code unchanged ... print "Hit enter when done: "; <STDIN>; ' Please enter first number 456 Please enter second number 123 123 456 Hit enter when done: I'm all done with this!

-- Ken


In reply to Re^3: Newbie cmd prompt problem by kcott
in thread Newbie cmd prompt problem by nquiton

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.