acid06 has asked for the wisdom of the Perl Monks concerning the following question:
package Class::Definition; use Attribute::Handlers; sub UNIVERSAL::DEFINITION : ATTR(CODE) { print "UNIVERSAL::DEFINITION: @_\n"; } 1;
I succesfully get this printed: UNIVERSAL::DEFINITION: main GLOB(0x283179c) CODE(0x225454) DEFINITION whatever CHECKuse Class::Definition; sub TEST : DEFINITION('whatever') {}
When it runs I get this error message:use warnings; use strict; use Class::Definition; sub CLASS : DEFINITION( ATTRIBUTES: PRIVATE: pvt_at1 pvt_at2 pvt_at3 PROTECTED: ptc_at1 ptc_at2 ptc_at3 PUBLIC: pub_at1 pub_at2 pub_at3 METHODS: PRIVATE: pvt_mt1 pvt_mt2 pvt_mt3 PROTECTED: ptc_mt1 ptc_mt2 ptc_mt3 PUBLIC: pub_mt1 pub_mt2 pub_mt3 );
Invalid CODE attribute: pub_mt1 ( ATTRIBUTES: PRIVATE: pvt_at1 pvt_at2 pvt_at3 PROTECTED: ptc_at1 ptc_at2 ptc_at3 PUBLIC: pub_at1 pub_at2 pub_at3 METHODS: PRIVATE: pvt_mt1 pvt_mt2 pvt_mt3 PROTECTED: ptc_mt1 ptc_mt2 ptc_mt3 PUBLIC: pub_mt1 pub_mt2 pub_mt3 ) at attrtest.pl line 6 BEGIN failed--compilation aborted at attrtest.pl line 18.
I get this as an error:use warnings; use strict; use Class::Definition; sub CLASS : DEFINITION( ATTRIBUTES: );
Invalid CODE attribute: INITION( ATTRIBUTES: ) at attrtest.pl line 6 BEGIN failed--compilation aborted at attrtest.pl line 9.
Edited by planetscape - added readmore tags
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Abusing attributes (possible perl bug?)
by chromatic (Archbishop) on Feb 08, 2006 at 07:15 UTC | |
Re: Abusing attributes (possible perl bug?)
by salva (Canon) on Feb 08, 2006 at 09:51 UTC | |
by acid06 (Friar) on Feb 08, 2006 at 14:04 UTC | |
by salva (Canon) on Feb 08, 2006 at 14:31 UTC | |
by TheDamian (Vicar) on Feb 08, 2006 at 20:18 UTC |