{ package My::App::Cmd; use base 'App::Cmd'; sub execute_command { my ($self, $cmd, $opt, @args) = @_; local our $active_cmd = $cmd; $cmd->validate_args($opt, \@args); $cmd->before_execute($opt, \@args); $cmd->execute($opt, \@args); } }