You might find Attribute::Handlers makes your life easier.
In reply to Re: learning subroutine attributes by adrianh in thread learning subroutine attributes by super_drone