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

Re: Perl 5.10: switch statement demo

by jdporter (Canon)
on Dec 19, 2007 at 20:26 UTC ( #657968=note: print w/ replies, xml ) Need Help??

in reply to Perl 5.10: switch statement demo

That doesn't look like a particularly apt illustration of given/when anyway, since it completely circumvents given's smart matching. It certainly doesn't look any better than

$_ % 3 or push @what, 'fizz'; $_ % 5 or push @what, 'buzz'; $_ % 7 or push @what, 'sausage';
which, as you pointed out, DWYM in this case, while given/when doesn't.

A word spoken in Mind will reach its own level, in the objective world, by its own weight

Comment on Re: Perl 5.10: switch statement demo
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://657968]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2015-11-29 11:10 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (750 votes), past polls