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