the author said "the number between 10 and 100"

I think the point you're making here is that the word 'between' implies an exclusive upper limit, and so the set of numbers being dealt with is the same as in the Perl list (10 .. 99), and for those numbers lexicographic and numeric comparison in a sort are equivalent. (Actually, Latnam wrote "... the range set to 10 thru 100 ..." [emphasis added] in the OP, but we could have the same "exclusive vs. inclusive upper limit" argument about 'thru' as about 'between'.)

I would agree that lexic and numeric comparison are equivalent over the set produced by (10 .. 99). However, the expression  int(rand(91))+10 used both in your example and in the OPed code does produce the number 100, and when this wildcard is thrown into the mix (as I assumed it would be given the explicit code and my interpretations of 'between' and 'thru'), the equivalence breaks down.

>perl -wMstrict -le "my @set = (10, 20, 100); my @a = sort @set; print qq{max in set (@set) is $a[$#a]}; " max in set (10 20 100) is 20

In reply to Re^4: Finding target unspecified value by AnomalousMonk
in thread Finding target unspecified value by Latnam

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.