Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Package-specific Attribute Handling and Multiple Inheritence

by Thilosophy (Curate)
on Sep 07, 2005 at 01:51 UTC ( #489740=note: print w/ replies, xml ) Need Help??


in reply to Re: Package-specific Attribute Handling and Multiple Inheritence
in thread Package-specific Attribute Handling and Multiple Inheritence

Thanks, I have started looking at Attribute::Handlers myself in the meantime. It does look a little scary inside, but I guess that cannot be avoided when dealing with attributes, and as you say, with its centralized handler that just dispatches to the actual attribute handlers it is quite interoperable when many modules try to register attributes.

Since this is for CGI::Application, it would have to play nice with mod_perl, though ... (I have recently even had a bug report from someone using Apache::Reload, which makes things even more tricky)


Comment on Re^2: Package-specific Attribute Handling and Multiple Inheritence
Re^3: Package-specific Attribute Handling and Multiple Inheritence
by xdg (Monsignor) on Sep 07, 2005 at 02:05 UTC

    Just make sure your handlers all run in the BEGIN phase. That will limit some of what you can do with them -- for example, you can get the name of a subroutine, but the code reference won't yet be defined. But that's no different than writing your own attribute handling code, so you've probably already dealt with it.

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://489740]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (17)
As of 2014-09-02 14:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (25 votes), past polls