http://qs321.pair.com?node_id=11118386


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