Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Efficient way to verify scalar contents (updated x3)

by ikegami (Pope)
on Jun 23, 2020 at 18:28 UTC ( #11118386=note: print w/replies, xml ) Need Help??


in reply to Re: Efficient way to verify scalar contents (updated x3)
in thread Efficient way to verify scalar contents

Note that given/when are unforunately still experimental

That's a good thing. Their design is broken. The only reason they haven't been removed is that too many people are using them despite that problems with them X_X.

  • Comment on Re^2: Efficient way to verify scalar contents (updated x3)

Replies are listed 'Best First'.
Re^3: Efficient way to verify scalar contents (updated x3)
by ikegami (Pope) on Jun 23, 2020 at 18:35 UTC

    Correction, smart-matching is the one with the broken design. I think given/when's only problem is that they sometimes use smart-matching. But without smart-matching, there's not much point to given/when. For example, the OP would avoid given/when by making nothing but the following changes:

    • given ⇒ for
    • first when ⇒ if
    • other when ⇒ elsif
    • default ⇒ else
      'given' has a return value, 'for' doesnt

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11118386]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2021-02-28 04:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?