in reply to RFC: Sub::Attributes -- alter subroutine context behavior with attributes

Looks cool, but why is the interface through a base class? From my understanding, Sub::Attributes are there to improve an aspect of functional programming. There is nothing class-related going on, and so providing a class-related interface does not seem to make sense. I haven't had time to look at the internals of Sub::Attributes (I have to procter an exam in 10 minutes), but was this the only way the functionality could work? Could the interface also be made to work through some crazy importation shenanegains?

  • Comment on Re: RFC: Sub::Attributes -- alter subroutine context behavior with attributes

Replies are listed 'Best First'.
Re: Re: RFC: Sub::Attributes -- alter subroutine context behavior with attributes
by Ovid (Cardinal) on Dec 10, 2003 at 00:24 UTC

    It uses a base class as that is the intended implementation from Attribute::Handlers. However, I could have made the attributes universal by stuffing them in the UNIVERSAL class, but that seemed like an abomination (even though many programmers are doing it -- I'm wondering if there is some benefit that I'm missing).

    I had tried setting it up via exporting, but I couldn't get it to work. Probably just a screwup in my syntax somewhere.

    Cheers,
    Ovid

    New address of my CGI Course.