optimize::subs method for perl