our %check; @check{@fields} = ( sub { $_[0] =~ m/^$RE{'URI'}$/; }, # . . . ); for (@fields) { my $check = $check{$_}; tie $hash{$_}, 'Tie::Constrained', sub { &$check && &detaint }; }