Subject: | No way to use attributes on code reload |
I'm using Attribute::Handlers to annotate handler subs for interactive
commands, to give them all help descriptions, specs for argument
parsing, options, etc...
sub command_help
: Command_description("Display help on a command")
: Command_args('command?')
{
my ( $command ) = @_;
...
}
This works fine the first time, but because I have a longrunning program
that's under development, I often like to be able to reload entire files
(by doing a variant of: delete $INC{...}; require $file)
If I do this, none of the attributes in the newly-loaded file are run. I
understand this is due to the deferred nature of how they work.
I'd like to have some ability to run these; either by:
run_new_attrs("CHECK"); # run any new attrs that should have been done
by "CHECK" time
run_attrs("Some/File.pm");
run_attrs("Some::Package");
run_attrs(\&Some::Package::func);
Would any of these be possible?
--
Paul Evans