I used perl today. Moose. I ran into a problem. It was annoying. I am way too stressed and tired to blog more. But I will anyway, secure in the knowledge that no one reads this blog but google’s spiders.
Okay anyway I used MooseX::Declare, and couldn’t get the method signature stuff to work. I did something like
method weekend_or_vacation (DateTime $dt){
# check if weekend or vacation
# with vacation being the tricky bit
if($vacation || $weekend){
return 1;
}else{
return 0;
}
}
But MooseX::Declare kept complaining that it didn’t know what DateTime was. I scanned the tests in t and sure enough, they all test simple things like Str and ArrayRef and so on, but none of the more magical parts of type checking.
I eventually solved it the old fashioned way by puking if the argument wasn’t a DateTime, but I’d rather do it the method signature way.