|
|
| P is for Practical | |
| PerlMonks |
Re^3: Right place to put common execute code in App::Cmdby tobyink (Prior) |
| on Dec 10, 2012 at 16:43 UTC ( #1008138=note: print w/ replies, xml ) | Need Help?? |
|
The relevant code is App::Cmd::execute_command. As you can see, nothing happens between validate_args and execute that you could possibly hook onto. One alternative approach could be to subclass App::Cmd, overriding that method with your own implementation that adds extra hooks between validate_args and execute:
Then use My::App::Cmd instead of App::Cmd.
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||