http://www.perlmonks.org?node_id=990014


in reply to Re^2: Short and easy way to write if...elsif syntax
in thread Short and easy way to write if...elsif syntax

The “clever improvements” as suggested cause each of the various if cases to become coupled.

(Some annoying typography elided.) How so—especially in the given/when case?

Replies are listed 'Best First'.
Re^4: Short and easy way to write if...elsif syntax
by Anonymous Monk on Aug 28, 2012 at 00:28 UTC
    Given/When is syntactic sugar for if..elsif.

      Perhaps I'm misunderstanding what you're saying, but given is a topicalizer, aliasing a lexically scoped $_ to a scalar's value which when operates on. The if/elsif construct doesn't create topics. Given this difference in functionality, how is given/when syntactic sugar for if/elsif?