I'd havemy $foo : shared = 'foo';
Note I'm trying to avoid the fully qualified syntax, i.e.,my $foo : Sociable = 'foo';
Which presumably means I need to install my attribute handlers into the UNIVERSAL space. Which does seem to work OK.my Thread::Sociable $foo : Sociable = 'foo';
I've tried using Attributes::Handler, but with marginal success...things behave very badly when run under the debugger.
My concern is that my solution is tromping all over other attributes apps. At present, I'm using the following bit of code to init the handlers:
and then calling the &$old_XXX_attr() with appropriate args after my SociableXXX() is done pulling out the attributes its interested in.our $old_scalar_attr = \&UNIVERSAL::MODIFY_SCALAR_ATTRIBUTES; our $old_array_attr = \&UNIVERSAL::MODIFY_ARRAY_ATTRIBUTES; our $old_hash_attr = \&UNIVERSAL::MODIFY_HASH_ATTRIBUTES; *UNIVERSAL::MODIFY_SCALAR_ATTRIBUTES = \&SociableScalar; *UNIVERSAL::MODIFY_ARRAY_ATTRIBUTES = \&SociableArray; *UNIVERSAL::MODIFY_HASH_ATTRIBUTES = \&SociableHash;
Am I way off base ? Is there a better way ? Any pointers (esp. to any code examples that do the same) much appreciated!
In reply to Attribute confusion by renodino
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |