Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: Short and easy way to write if...elsif syntax

by chromatic (Archbishop)
on Aug 27, 2012 at 16:20 UTC ( #990014=note: print w/replies, xml ) Need Help??


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?

  • Comment on Re^3: Short and easy way to write if...elsif syntax

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?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://990014]
help
Chatterbox?
choroba tries to grep -i choroba absg.html
[erix]: I count 3 (+1 in the list)-- wel done :)
[choroba]: I've read it body to /body and experimented a lot...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2017-11-24 12:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (348 votes). Check out past polls.

    Notices?