On 2015-10-14 01:49 PM, Stefan Hornburg (Racke) wrote:
Yanick, would you mind to enhance the POD with this example?
Done. And sometime tomorrow (ie, as soon as I merge my changes), defining plugin keywords will get even easier: # the classic plugin_keywords 'foo', [ 'bar', 'baz' ], quux => sub { ... }; # tag methods as keywords sub some_keyword :PluginKeyword { ...; } # keyword will be 'bar' sub foo :PluginKeyword(bar) { ... } # keywords "do_it" and "do_them" will both use the method sub do_studd :PluginKeyword(do_it do_them) { ... } # attributes can be exported as keywords too has foo => ( is => 'ro', plugin_keyword => 1, # will use keyword 'foo' ); has bar => ( is => 'ro', plugin_keyword => 'baz', # will use keyword 'baz' ); has quux => ( is => 'ro', plugin_keyword => [qw/ this that / ], # will use keyword 'this' and 'that' ); Joy, `/.