[Omaha.pm] Do you ~~ ?
Theodore Katseres
tedkat at gmail.com
Thu Apr 1 11:52:44 PDT 2010
2010/4/1 Jay Hannah <jay at jays.net>
> Wow. smartmatch.
>
> use 5.10.0;
> if ($a ~~ $b) {
>
> http://perldoc.perl.org/perlsyn.html#Smart-matching-in-detail
>
> Anyone use this beast?
>
I use implicit smart matching with the when statement the most.
eg.
given ( $a ) {
when ( $b ) { dosomething(); }
default { dosomethingelse(); }
}
--
Ted Katseres
||=O=||
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/omaha-pm/attachments/20100401/6457631e/attachment.html>
More information about the Omaha-pm
mailing list