[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] Do you ~~ ?



2010/4/1 Jay Hannah <jay@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=||