in reply to How to get function's name inside of CODE attribute
You can't always get a name (as attributes can apply to anonymous functions), but Sub::Information can help:
use Attribute::Lexical 'CODE:FOO' => \&handle_foo_attr;
my ($func, $identifier, $attrs, $caller) = @_;
my $info = Sub::Information->new( $func );
my $name = $info->name;
say "Function '$name' has FOO attribute";
I added in Attribute::Lexical to avoid the need to monkeypatch UNIVERSAL.