Defining Moose Types 

package MyAppTypes;

use Moose::Util::TypeConstraints;

subtype 'StarRating'
    => as 'Int'
    => where { $_ >= 1 and $_ <= 5 }
    => message { "Rating must be 1 - 5" };

1;