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

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

by ikegami (Patriarch)
on Jun 23, 2020 at 18:28 UTC ( [id://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 (Patriarch) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11118386]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-25 18:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found