Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

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


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

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
  • Comment on Re^3: Efficient way to verify scalar contents (updated x3)

Replies are listed 'Best First'.
Re^4: Efficient way to verify scalar contents (updated x3)
by Anonymous Monk on Jun 23, 2020 at 19:29 UTC
    '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://11118387]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2020-09-21 15:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (126 votes). Check out past polls.

    Notices?