<br><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br>...but how about some additional awesome magic?</blockquote><div><br>Who doesn't like magic? :)
<br> </div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> given ($variable) {<br> when (1) { # $variable == 1<br> do_something_one;
<br> }<br><br> when (@edge_cases) { # if $variable in @edge_cases<br> do_edge_case_handler;<br> }<br><br> when ($_ > 10e6) { # if $variable is over a million<br> do_huge_handler;<br> }<br><br> when (\&test) { # if test($_) is true
<br> say "the test was true!";<br> continue;<br> }<br><br> default {<br> default_handler;<br> }<br> }</blockquote><div><br>Regex?<br><br>___SNIP___<br><br>when ( /^\Q$somepattern\E$/)<br>
{<br> say "seen $somepattern"<br>}<br><br>___SNIP___<br> </div><br></div><br clear="all"><br>-- <br>"You are never dedicated to something you have complete confidence in. No one is fanatically shouting that the sun is going to rise tomorrow. They know it's going to rise tomorrow. "
<br> -- Robert M Pirsig