package Dispatcher; use strict; use warnings; use Attribute::Handlers; sub xmlrpc_methods { my @methods = (); my $package = shift; { no strict 'refs'; for my $key ( %{$package.'::'} ) { next unless my $code = *{$package.'::'.$key}{CODE}; push @methods, $key if grep { $_ eq 'xmlrpc' } attributes::get($code); } } return @methods; } 1; sub xmlrpc :ATTR(CODE) {} package MyClass; use base qw(Dispatcher); sub foo : xmlrpc { } 1;