use attributes (); # optional, to get subroutine declarations my @attrlist = attributes::get(\&foo);