in reply to Succinct switch statement
I don't know how to get rid of given, but you could make it look a little less redundant:
I think it would look prettier aswhile (1) { given (<>) { when (…) {…} default { last } } }
but that gets you chastised about using last outside a loop block.do { given (<>) { when (…) {…} default { last } } } while 1;
As others have observed, say '' is the same as print "\n". Have you thought about whether setting $\ will fulfil your needs?
|
|---|