TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Given/when - The Perl switch statement

37 pointsby progover 14 years ago

5 comments

Vivtekover 14 years ago
What is this, National Perl Appreciation Day or something? This is great!<p>Useless in practice for me; I write for CPAN, so I have to stay backward-compatible at least to 5.6. But a nice taste of what I'll start doing in 2015 or so.
评论 #2132823 未加载
评论 #2133473 未加载
scorchinover 14 years ago
Despite not knowing much Perl, seeing Given/When being used as executable code is beautiful.<p>It's almost like someone took Gherkin (the Cucumber BDD parser) and got it working inline.
评论 #2133340 未加载
samuel1604over 14 years ago
it has been a long time since I have done any Perl but it's always a pleasure like seeing a old friend!
sendosover 14 years ago
Can someone explain why given/when is better than switch/case?<p>From the examples in the link, I don't see an essential difference or benefit to the developer.
评论 #2133295 未加载
评论 #2133281 未加载
评论 #2132856 未加载
评论 #2133130 未加载
评论 #2132916 未加载
xsltuser2010over 14 years ago
Will 'while' be replaced with 'aslongas' ?
评论 #2132879 未加载