If you want to keep the $number ~~ [1416..1494] notation without the inefficiencies of it and the problems inherent with using smart-matching, you could use

in_range( $number, 1416, 1494 )

But I would use the following instead:

1416 <= $number <= 1494

Also is this depreciation of smartmatch definitive or is there a chance that the Perl devs will change their mind and keep it?

Its buggy due to a broken design, and it's being removed in 5.42.

5.10: Somehow introduced despite the known broken design.
5.10.1: Backwards incompatible change because it was so bad in 5.10.0. But didn't address the broken design. (That would be impossible without completely changing what the operator does.)
5.16: Becomes experimental (in the documentation).
5.18: Using experimental features now warn.
5.38: Becomes deprecated. It was announced it would be removed in 5.42.

There's a clear path towards removal. And the above severely understates the chaos the feature has caused. The feature and chaos resulted in the creation policies to make new features experimental, backed with the creation of a formal system for warning when experimental features are used. They also caused the policies for backwards compatibility and the breakage thereof to be formalized. Finally, the above doesn't mention the various pushes to have the failed experiment removed, attempts that were stymied by the presence of a large user base.


In reply to Re: using smartmatch for range matching by ikegami
in thread using smartmatch for range matching by perltux

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.