We modify constraint so that the value pass is automatically dereferenced
+=cut
+
around 'constraint' => sub {
my ($constraint, $self) = @_;
return sub {
my ($arg) = @_;
- $self->$constraint->(@$arg);
+ $self->$constraint->($arg);
};
};
ok UniqueInt->check([2,[3..6]]), 'PASS unique in set';
ok UniqueInt->check([3,[100..110]]), 'PASS unique in set';
- ## Same as above, with suger
+ ## Same as above, with sugar
subtype UniqueInt2,
as depending {
my ($dependent_int, $constraining_arrayref) = @_;