package dispatch; my %disallowed = ( security => 1, ); sub security { # Handle security here, somehow, returning a boolean. } # Because we're overloading can(), we can easily make it play nicely with AUTOLOAD. sub can { my $proto = shift; my ($method) = @_; return '' if $disallowed{$method}; UNIVERSAL::can($proto, $method); } #### Functions to dispatch to below here --------------- if (dispatch->security( ... ) and my $method = dispatch->can( ... )) { $method->(@args); }