Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2024-06-18 09:52 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.